OSDN Git Service

Enforce null check for mAccessPoint
authorNingyuan Wang <nywang@google.com>
Fri, 3 Nov 2017 18:16:56 +0000 (11:16 -0700)
committerNingyuan Wang <nywang@google.com>
Wed, 8 Nov 2017 18:24:48 +0000 (18:24 +0000)
mAccessPoint == null implies this is a new network.
In this case, we don't need to check if it's a carrier AP.

Bug: 68846574
Test: compile, manually test that crash does not happen again.
Test: make RunSettingsRoboTests -j40 aROBOTEST_FILTER=WifiConfigControllerTest

Change-Id: I03b1da5e8f0b8e4270c0c52c67bbc90c999be078
(cherry picked from commit 0117b995f44758a64b7af6d2d11e17d10ef125ce)

src/com/android/settings/wifi/WifiConfigController.java

index 6935749..ecd4b59 100644 (file)
@@ -1030,7 +1030,7 @@ public class WifiConfigController implements TextWatcher,
                 setUserCertInvisible();
                 setPasswordInvisible();
                 setIdentityInvisible();
-                if (mAccessPoint.isCarrierAp()) {
+                if (mAccessPoint != null && mAccessPoint.isCarrierAp()) {
                     setEapMethodInvisible();
                 }
                 break;