From 0f3746ae1268fef69d52e593c4860a2153dba98f Mon Sep 17 00:00:00 2001 From: Joey Grover Date: Fri, 21 Dec 2018 11:52:48 -0500 Subject: [PATCH] Add null check before accessing packetWriteMap --- .../com/smartdevicelink/transport/SdlRouterService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java index a6069c8e15..54a078698a 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java +++ b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java @@ -3151,9 +3151,11 @@ public void handleMessage(int flags, byte[] packet, TransportType transportType) PacketWriteTaskBlockingQueue queue = queues.get(transportType); if (queue != null) { queue.add(new PacketWriteTask(bytes, 0, bytes.length, this.priorityForBuffingMessage,transportType)); - PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(transportType); - if (packetWriteTaskMaster != null) { - packetWriteTaskMaster.alert(); + if(packetWriteTaskMasterMap != null) { + PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(transportType); + if (packetWriteTaskMaster != null) { + packetWriteTaskMaster.alert(); + } } } buffer.close();