diff options
author | Aleks Rozman <arozman@google.com> | 2017-09-03 22:49:55 -0700 |
---|---|---|
committer | Aleks Rozman <arozman@google.com> | 2017-09-06 02:19:54 +0000 |
commit | 3abc7f056111caae01f0cd47f57798903bf7b054 (patch) | |
tree | 4beeed14c3580708120ed8da57d0eac8f3f81cb5 /service | |
parent | 82b1626bbd8bad5ffc557f108e2dc36b312b6a82 (diff) |
Handle a condition when the result of getting configured networks returns null
Linked with ag/2842135
BUG:65267749
Change-Id: Idebc1b76f454640a2b493db9fb4bf263c0e448f5
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiStateMachine.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 92fcd81bd..d52880ad5 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -2015,9 +2015,13 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss public List<WifiConfiguration> syncGetConfiguredNetworks(int uuid, AsyncChannel channel) { Message resultMsg = channel.sendMessageSynchronously(CMD_GET_CONFIGURED_NETWORKS, uuid); - List<WifiConfiguration> result = (List<WifiConfiguration>) resultMsg.obj; - resultMsg.recycle(); - return result; + if (resultMsg == null) { // an error has occurred + return null; + } else { + List<WifiConfiguration> result = (List<WifiConfiguration>) resultMsg.obj; + resultMsg.recycle(); + return result; + } } public List<WifiConfiguration> syncGetPrivilegedConfiguredNetwork(AsyncChannel channel) { |