6161import org .springframework .util .Assert ;
6262import org .springframework .util .ClassUtils ;
6363import org .springframework .util .CollectionUtils ;
64+ import org .springframework .util .ObjectUtils ;
6465import org .springframework .util .StringUtils ;
6566import org .springframework .util .comparator .NullSafeComparator ;
6667
@@ -289,22 +290,22 @@ protected Object readProperty(String path, RedisData source, RedisPersistentProp
289290 if (!source .getBucket ().hasValue (currentPath ) && isByteArray (typeInformation )) {
290291
291292 return readCollectionOrArray (currentPath , typeInformation .getType (),
292- typeInformation .getRequiredComponentType ().getActualType (). getType (), source .getBucket ());
293+ typeInformation .getRequiredComponentType ().getType (), source .getBucket ());
293294 }
294295 } else {
295296 return readCollectionOrArray (currentPath , typeInformation .getType (),
296- typeInformation .getRequiredComponentType ().getActualType (). getType (), source .getBucket ());
297+ typeInformation .getRequiredComponentType ().getType (), source .getBucket ());
297298 }
298299 }
299300
300301 if (persistentProperty .isEntity ()
301- && !conversionService .canConvert (byte [].class , typeInformation .getActualType ().getType ())) {
302+ && !conversionService .canConvert (byte [].class , typeInformation .getRequiredActualType ().getType ())) {
302303
303304 Bucket bucket = source .getBucket ().extract (currentPath + "." );
304305
305306 RedisData newBucket = new RedisData (bucket );
306307 TypeInformation <?> typeToRead = typeMapper .readType (bucket .getPropertyPath (currentPath ),
307- typeInformation . getActualType () );
308+ typeInformation );
308309
309310 return readInternal (currentPath , typeToRead .getType (), newBucket );
310311 }
@@ -315,8 +316,12 @@ protected Object readProperty(String path, RedisData source, RedisPersistentProp
315316 return null ;
316317 }
317318
318- if (persistentProperty .isIdProperty () && StringUtils .isEmpty (path .isEmpty ())) {
319- return sourceBytes == null ? fromBytes (sourceBytes , typeInformation .getActualType ().getType ()) : source .getId ();
319+ if (persistentProperty .isIdProperty () && ObjectUtils .isEmpty (path .isEmpty ())) {
320+ return sourceBytes != null ? fromBytes (sourceBytes , typeInformation .getType ()) : source .getId ();
321+ }
322+
323+ if (sourceBytes == null ) {
324+ return null ;
320325 }
321326
322327 Class <?> typeToUse = getTypeHint (currentPath , source .getBucket (), persistentProperty .getType ());
0 commit comments