diff --git a/engine/src/networking/com/jme3/network/serializing/serializers/EnumSerializer.java b/engine/src/networking/com/jme3/network/serializing/serializers/EnumSerializer.java index e3d87e8e0..f4e5ed3c3 100644 --- a/engine/src/networking/com/jme3/network/serializing/serializers/EnumSerializer.java +++ b/engine/src/networking/com/jme3/network/serializing/serializers/EnumSerializer.java @@ -33,6 +33,7 @@ package com.jme3.network.serializing.serializers; import com.jme3.network.serializing.Serializer; +import com.jme3.network.serializing.SerializerException; import java.io.IOException; import java.nio.ByteBuffer; @@ -48,6 +49,8 @@ public class EnumSerializer extends Serializer { if (ordinal == -1) return null; T[] enumConstants = c.getEnumConstants(); + if (enumConstants == null) + throw new SerializerException( "Class has no enum constants:" + c ); return enumConstants[ordinal]; } catch (IndexOutOfBoundsException ex) { return null;