diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java index 6c8be89c..b8a638b2 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java @@ -36,7 +36,7 @@ public class InteractionWiredHighscore extends HabboItem { try { String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0]; - int ctype = Integer.valueOf(this.getBaseItem().getName().split("\\*")[1]) - 1; + int ctype = Integer.parseInt(this.getBaseItem().getName().split("\\*")[1]) - 1; this.scoreType = WiredHighscoreScoreType.valueOf(name); this.clearType = WiredHighscoreClearType.values()[ctype]; } catch (Exception e) { @@ -54,7 +54,7 @@ public class InteractionWiredHighscore extends HabboItem { try { String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0]; - int ctype = Integer.valueOf(this.getBaseItem().getName().split("\\*")[1]) - 1; + int ctype = Integer.parseInt(this.getBaseItem().getName().split("\\*")[1]) - 1; this.scoreType = WiredHighscoreScoreType.valueOf(name); this.clearType = WiredHighscoreClearType.values()[ctype]; } catch (Exception e) { @@ -81,7 +81,7 @@ public class InteractionWiredHighscore extends HabboItem { @Override public void onClick(GameClient client, Room room, Object[] objects) throws Exception { - if (!((client != null && room != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType))) + if (room == null || !((client != null && room.hasRights(client.getHabbo())) || (objects.length >= 2 && objects[1] instanceof WiredEffectType))) return; if (this.getExtradata() == null || this.getExtradata().isEmpty() || this.getExtradata().length() == 0) { @@ -89,7 +89,7 @@ public class InteractionWiredHighscore extends HabboItem { } try { - int state = Integer.valueOf(this.getExtradata()); + int state = Integer.parseInt(this.getExtradata()); this.setExtradata(Math.abs(state - 1) + ""); room.updateItem(this); } catch (Exception e) {