room is nullable here

This commit is contained in:
brenoepic 2022-04-29 22:39:44 -03:00
parent f70d05ae49
commit 8f4c53504b

View File

@ -18,7 +18,7 @@ public class InteractionVoteCounter extends HabboItem {
private boolean frozen; private boolean frozen;
private int votes; private int votes;
private List<Integer> votedUsers; private final List<Integer> votedUsers;
public InteractionVoteCounter(ResultSet set, Item baseItem) throws SQLException { public InteractionVoteCounter(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem); super(set, baseItem);
@ -69,7 +69,7 @@ public class InteractionVoteCounter extends HabboItem {
@Override @Override
public void onClick(GameClient client, Room room, Object[] objects) throws Exception { 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; return;
this.frozen = !this.frozen; this.frozen = !this.frozen;