From e11185cf2d8ac0a0272bf90c6e0c454009289102 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Fri, 13 Aug 2021 22:48:21 -0400 Subject: [PATCH] getPlayerData fix --- src/main/java/net/tylermurphy/hideAndSeek/Store.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/Store.java b/src/main/java/net/tylermurphy/hideAndSeek/Store.java index 090bd2c..d628ad1 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/Store.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/Store.java @@ -39,7 +39,12 @@ public class Store { } public static int getPlayerData(String playerName, String key) { - return playerData.get(playerName + " " + key) == null ? 0 : playerData.get(playerName + "" + key); + if(playerData == null) return 0; + if(playerData.get(playerName + " " + key) == null) { + return 0; + } else { + return playerData.get(playerName + " " + key); + } } public static void setPlayerData(String playerName, String key, int value) {