Skip to content

Commit

Permalink
Use Double.intValue() instead of casting
Browse files Browse the repository at this point in the history
Casting Double to Integer results in an unhandled exception.
  • Loading branch information
kgmt0 authored and LaCuneta committed Oct 2, 2023
1 parent fdf1c1e commit 9092cba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HIDGogoExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,8 @@ public void perform(Argument[] args, Context ctx)
LogoList messageList = args[0].getList();
byte[] message = new byte[64];
for (int i = 0; i<messageList.size() && i < 64; i++) {
Object val = messageList.get(i);
int v = (Integer)val;
Double val = (Double)messageList.get(i);
int v = val.intValue();
message[i] = (byte)v;
}
sendMessage(message);
Expand Down

0 comments on commit 9092cba

Please sign in to comment.