From 176cf2c2186951c90a38cf3f9a65418ae1f872ee Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Fri, 29 Apr 2022 22:42:14 -0300 Subject: [PATCH] room nullable.. --- .../items/interactions/InteractionWiredHighscore.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) {