Skip to content

Commit

Permalink
Minor tweak to SerializeToPDC.deserialize
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSmimg committed Oct 7, 2024
1 parent 053f80f commit acd4673
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ public static void serialize(PersistentDataContainer pdc, NamespacedKey key, Obj
* @param pdc The PersistentDataContainer to deserialize from
* @param key The NamespacedKey to deserialize from
* @throws RuntimeException if the serializer raises IOException - see serialization.SerializeToBytes
* @return `null` if the object was unable to be deserialized. Otherwise, the Object
* @return `null` if the object was unable to be deserialized or the location in PDC was null. Otherwise, the Object
*/
public static @Nullable Object deserialize(PersistentDataContainer pdc, NamespacedKey key) {
byte[] bytes = pdc.get(key, PersistentDataType.BYTE_ARRAY);
if (bytes == null) return null;
try {
return SerializeToBytes.deserialize(bytes);
} catch (IOException e) {
Expand Down

0 comments on commit acd4673

Please sign in to comment.