diff --git a/.classpath b/.classpath index 234db15..25dd6e5 100644 --- a/.classpath +++ b/.classpath @@ -11,15 +11,9 @@ - - - - - - - - + + diff --git a/src/main/java/tk/valoeghese/sod/DataSection.java b/src/main/java/tk/valoeghese/sod/DataSection.java index 8795464..6536b08 100644 --- a/src/main/java/tk/valoeghese/sod/DataSection.java +++ b/src/main/java/tk/valoeghese/sod/DataSection.java @@ -26,7 +26,15 @@ public class DataSection implements Iterable { return (double) this.data.get(index); } public > T readEnum(int index, T[] values) - { return values[(int) this.data.get(index)]; } + { + Integer i = (Integer) this.data.get(index); + + if (i == null) { + return null; + } + + return values[i]; + } public > T readEnumString(int index, Class type) { return Enum.valueOf(type, (String) this.data.get(index)); }