Skip to content

Commit c79bf0f

Browse files
author
Tyler MacEachern
committed
Fixes cast exception.
1 parent f5cf08c commit c79bf0f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/configuration/Settings.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ public void loadFromFile() throws IOException, ParseException {
148148
final JSONObject jsonObject = (JSONObject) jsonParser.parse(new FileReader("config.json"));
149149

150150
jsonObject.forEach((key, value) -> {
151-
settings.put((String) key, (String) value);
151+
if (value instanceof String == false) {
152+
settings.put((String) key, value.toString());
153+
} else {
154+
settings.put((String) key, (String) value);
155+
}
152156
});
153157
} catch (final IOException e) {
154158
writeToFile();

0 commit comments

Comments
 (0)