From 0f8285e1e039af673f0cc3a3d76ed071da875d79 Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Fri, 1 Jun 2018 16:47:42 -0700 Subject: [WIFI] Add null check before variable access to prevent an APR Bug: 80498990 Test: None - not clear how to trigger Change-Id: Ic86a3ca660aa364a647e80577e6c7a92599b1da7 --- .../java/com/android/server/wifi/util/WifiAsyncChannel.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/service/java/com/android/server/wifi/util/WifiAsyncChannel.java b/service/java/com/android/server/wifi/util/WifiAsyncChannel.java index 08025e3ea..4526d68a4 100644 --- a/service/java/com/android/server/wifi/util/WifiAsyncChannel.java +++ b/service/java/com/android/server/wifi/util/WifiAsyncChannel.java @@ -90,10 +90,12 @@ public class WifiAsyncChannel extends AsyncChannel { .c(msg.what) .flush(); Message replyMessage = super.sendMessageSynchronously(msg); - getOrInitLog().trace("sendMessageSynchronously.recv message=% sendingUid=%") - .c(replyMessage.what) - .c(replyMessage.sendingUid) - .flush(); + if (replyMessage != null) { + getOrInitLog().trace("sendMessageSynchronously.recv message=% sendingUid=%") + .c(replyMessage.what) + .c(replyMessage.sendingUid) + .flush(); + } return replyMessage; } -- cgit v1.2.3