summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-02-09 23:32:57 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-02-09 23:32:57 +0100
commit9deac08466eb1b01e0d5a82c6923705bd1922aa0 (patch)
tree3896c3dd13a3c41f77b0a2ec8555d3ec15a2b0a7
parent359b87fa8bd3a77dc097c1c125c5b3e7cc9b43ee (diff)
downloadRustAndDust-9deac08466eb1b01e0d5a82c6923705bd1922aa0.zip
RustAndDust-9deac08466eb1b01e0d5a82c6923705bd1922aa0.tar.gz
Config: protect load(String) against null payload
-rw-r--r--core/src/ch/asynk/rustanddust/game/Config.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Config.java b/core/src/ch/asynk/rustanddust/game/Config.java
index fccd142..9fd3a43 100644
--- a/core/src/ch/asynk/rustanddust/game/Config.java
+++ b/core/src/ch/asynk/rustanddust/game/Config.java
@@ -116,6 +116,7 @@ public class Config
public void load(String payload)
{
+ if (payload == null) return;
JsonValue root = new JsonReader().parse(payload);
this.gameMode = GameMode.valueOf(root.getString("mode"));
this.debug = root.getBoolean("debug");