A change from a while back that presents a slightly better
error message than an NPE but still isn't very helpful. This usually only happens when things are totally confused, ie: stream corruption or more likely misregistered classes. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8068 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
8198719cdf
commit
8f90e62fec
@ -33,6 +33,7 @@
|
|||||||
package com.jme3.network.serializing.serializers;
|
package com.jme3.network.serializing.serializers;
|
||||||
|
|
||||||
import com.jme3.network.serializing.Serializer;
|
import com.jme3.network.serializing.Serializer;
|
||||||
|
import com.jme3.network.serializing.SerializerException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
@ -48,6 +49,8 @@ public class EnumSerializer extends Serializer {
|
|||||||
|
|
||||||
if (ordinal == -1) return null;
|
if (ordinal == -1) return null;
|
||||||
T[] enumConstants = c.getEnumConstants();
|
T[] enumConstants = c.getEnumConstants();
|
||||||
|
if (enumConstants == null)
|
||||||
|
throw new SerializerException( "Class has no enum constants:" + c );
|
||||||
return enumConstants[ordinal];
|
return enumConstants[ordinal];
|
||||||
} catch (IndexOutOfBoundsException ex) {
|
} catch (IndexOutOfBoundsException ex) {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user