Skip to content

Commit

Permalink
Fix Packet Profiler NPE
Browse files Browse the repository at this point in the history
Signed-off-by: Ross Allan <rallanpcl@gmail.com>
  • Loading branch information
LunNova committed Jul 29, 2013
1 parent 32d8c08 commit 12e3677
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -110,8 +110,9 @@ public static void record(final Packet packet) {
int size;
if (packet instanceof Packet250CustomPayload) {
Packet250CustomPayload packet250CustomPayload = (Packet250CustomPayload) packet;
id = ((Packet250CustomPayload) packet).channel + (packet250CustomPayload.data.length > 0 ? Byte.toString(packet250CustomPayload.data[0]) : Byte.MIN_VALUE);
size = packet250CustomPayload.data.length;
byte[] data = packet250CustomPayload.data;
size = data == null ? 0 : data.length;
id = packet250CustomPayload.channel + (size > 0 ? Byte.toString(data[0]) : Byte.MIN_VALUE);
} else {
id = String.valueOf(packet.getPacketId());
size = packet.getPacketSize();
Expand Down

0 comments on commit 12e3677

Please sign in to comment.