Skip to content

Commit

Permalink
Check before casting
Browse files Browse the repository at this point in the history
Fix #88
  • Loading branch information
ChanceSD committed Dec 10, 2015
1 parent 7f2de1c commit 642f81b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions PvPManager/src/main/java/me/NoChance/PvPManager/PvPlayer.java
Expand Up @@ -231,8 +231,12 @@ public final void loadState() {
}

public void loadData(final Map<String, Object> userData) {
this.pvpState = (boolean) userData.get("pvpstatus");
this.toggleTime = (long) userData.get("toggletime");
if (userData.get("pvpstatus") instanceof Boolean) {
this.pvpState = (boolean) userData.get("pvpstatus");
}
if (userData.get("toggletime") instanceof Long) {
this.toggleTime = (long) userData.get("toggletime");
}
}

public final void updatePlayer(final Player p) {
Expand Down

0 comments on commit 642f81b

Please sign in to comment.