From 12ecdb7b85152b47a5469f0942f3e9d811d6d90b Mon Sep 17 00:00:00 2001 From: vandwalle Date: Thu, 13 Nov 2014 11:48:29 -0800 Subject: check for null pointers when processing CMD_START_SCAN Change-Id: Icc3bcb37d181e6f28673808d5c3239d18c6a482f --- service/java/com/android/server/wifi/WifiStateMachine.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 25d954085..52aaebc7a 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -1789,10 +1789,16 @@ public class WifiStateMachine extends StateMachine { } private void handleScanRequest(int type, Message message) { + ScanSettings settings = null; + WorkSource workSource = null; + // unbundle parameters Bundle bundle = (Bundle) message.obj; - ScanSettings settings = bundle.getParcelable(CUSTOMIZED_SCAN_SETTING); - WorkSource workSource = bundle.getParcelable(CUSTOMIZED_SCAN_WORKSOURCE); + + if (bundle != null) { + settings = bundle.getParcelable(CUSTOMIZED_SCAN_SETTING); + workSource = bundle.getParcelable(CUSTOMIZED_SCAN_WORKSOURCE); + } // parse scan settings String freqs = null; -- cgit v1.2.3