mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-01-06 00:18:38 +01:00
The serializer can be null
But this will cause issues when trying to register objects
This commit is contained in:
parent
11ba322b5f
commit
7077037bb7
@ -542,9 +542,9 @@ public class WrappedDataWatcher extends AbstractWrapper implements Iterable<Wrap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets this watcher object's serializer.
|
* Gets this watcher object's serializer. Will return null if the serializer was never specified.
|
||||||
*
|
*
|
||||||
* @return The serializer
|
* @return The serializer, or null
|
||||||
*/
|
*/
|
||||||
public Serializer getSerializer() {
|
public Serializer getSerializer() {
|
||||||
if (getSerializer == null) {
|
if (getSerializer == null) {
|
||||||
@ -553,12 +553,15 @@ public class WrappedDataWatcher extends AbstractWrapper implements Iterable<Wrap
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object serializer = getSerializer.invoke(handle);
|
Object serializer = getSerializer.invoke(handle);
|
||||||
|
if (serializer != null) {
|
||||||
Serializer wrapper = Registry.fromHandle(serializer);
|
Serializer wrapper = Registry.fromHandle(serializer);
|
||||||
if (wrapper != null) {
|
if (wrapper != null) {
|
||||||
return wrapper;
|
return wrapper;
|
||||||
|
} else {
|
||||||
|
return new Serializer(null, serializer, false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return new Serializer(null, serializer, false);
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user