Skip to content

Commit 3270573

Browse files
committed
Fix NPE when serializing an EffectInstance with no hidden effects.
1 parent a2d8178 commit 3270573

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Common/src/main/java/net/darkhax/bookshelf/api/serialization/SerializerEffectInstance.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void toByteBuf(FriendlyByteBuf buffer, MobEffectInstance toWrite) {
8989
Serializers.BOOLEAN.toByteBuf(buffer, toWrite.isAmbient());
9090
Serializers.BOOLEAN.toByteBuf(buffer, toWrite.isVisible());
9191
Serializers.BOOLEAN.toByteBuf(buffer, toWrite.showIcon());
92-
Serializers.EFFECT_INSTANCE.toByteBufOptional(buffer, Optional.of(((AccessorMobEffectInstance) toWrite).bookshelf$getHiddenEffect()));
92+
Serializers.EFFECT_INSTANCE.toByteBufOptional(buffer, Optional.ofNullable(((AccessorMobEffectInstance) toWrite).bookshelf$getHiddenEffect()));
9393
}
9494

9595
@Override

0 commit comments

Comments
 (0)