From 9e665656f3fb48b8e0f967b14d29f926f6bf4369 Mon Sep 17 00:00:00 2001 From: valoeghese Date: Wed, 26 Feb 2020 20:43:31 +1300 Subject: [PATCH] e --- .classpath | 10 ++-------- src/main/java/tk/valoeghese/sod/DataSection.java | 10 +++++++++- 2 files changed, 11 insertions(+), 9 deletions(-) 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)); }