Skip to content

Commit

Permalink
Fixes cast exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler MacEachern committed Dec 5, 2017
1 parent f5cf08c commit c79bf0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/configuration/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ public void loadFromFile() throws IOException, ParseException {
final JSONObject jsonObject = (JSONObject) jsonParser.parse(new FileReader("config.json"));

jsonObject.forEach((key, value) -> {
settings.put((String) key, (String) value);
if (value instanceof String == false) {
settings.put((String) key, value.toString());
} else {
settings.put((String) key, (String) value);
}
});
} catch (final IOException e) {
writeToFile();
Expand Down

0 comments on commit c79bf0f

Please sign in to comment.