From 8d6010fde3c5d603238e1bc334489053d498c14f Mon Sep 17 00:00:00 2001 From: skeletor Date: Sun, 19 Jan 2020 20:42:51 -0500 Subject: [PATCH] added remaining NumberFormatExceptions in totem interactions to try/catch block --- .../items/interactions/totems/InteractionTotemHead.java | 7 ++++++- .../items/interactions/totems/InteractionTotemLegs.java | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemHead.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemHead.java index b0e63eb8..aa9dcb62 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemHead.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemHead.java @@ -35,7 +35,12 @@ public class InteractionTotemHead extends InteractionDefault { } public TotemColor getTotemColor() { - int extraData = Integer.parseInt(this.getExtradata()); + int extraData; + try { + extraData = Integer.parseInt(this.getExtradata()); + }catch(NumberFormatException ex) { + extraData = 0; + } if(extraData < 3) { return TotemColor.NONE; } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemLegs.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemLegs.java index 4555a2f9..d8d83da4 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemLegs.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemLegs.java @@ -31,7 +31,12 @@ public class InteractionTotemLegs extends InteractionDefault { } public TotemColor getTotemColor() { - int extraData = Integer.parseInt(this.getExtradata()); + int extraData; + try { + extraData = Integer.parseInt(this.getExtradata()); + } catch(NumberFormatException ex) { + extraData = 0; + } return TotemColor.fromInt(extraData - (4 * (getTotemType().type - 1))); }