Detect custom deserialized NullValue instances

Closes gh-36727

(cherry picked from commit 916cb64581)
This commit is contained in:
Juergen Hoeller
2026-04-29 22:02:13 +02:00
parent a58fdeaf3f
commit 8b5cbb7496
2 changed files with 9 additions and 1 deletions
@@ -87,7 +87,7 @@ public abstract class AbstractValueAdaptingCache implements Cache {
*/
@Nullable
protected Object fromStoreValue(@Nullable Object storeValue) {
if (this.allowNullValues && storeValue == NullValue.INSTANCE) {
if (this.allowNullValues && storeValue instanceof NullValue) {
return null;
}
return storeValue;