added remaining NumberFormatExceptions in totem interactions to try/catch block

This commit is contained in:
skeletor 2020-01-19 20:42:51 -05:00 committed by Harmonic
parent df2c7ee8a8
commit 8d6010fde3
2 changed files with 12 additions and 2 deletions

View File

@ -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;
}

View File

@ -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)));
}