commit | 48d453d9530ca8294d619beddc57a6e45fc62198 | [log] [tgz] |
---|---|---|
author | Adrian Roos <roosa@google.com> | Thu Aug 07 15:55:18 2014 +0200 |
committer | The Android Automerger <android-build@android.com> | Thu Aug 07 11:51:13 2014 -0700 |
tree | abcf1cf3194f68300a521b9ab5856dc47328c5c3 | |
parent | 9f2b71b8dacf6a8d340bb0a81f8db48d1408418d [diff] |
Fix NPE in DevicePolicyManagerService that crashed SystemUI Bug: 16857795 Change-Id: I6234f03c4ee31311af9f9c556b790594ee1a8b2f
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 8e59844..fc96991 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -2850,7 +2850,8 @@ if (mHasFeature) { ActiveAdmin strictestAdmin = getAdminWithMinimumFailedPasswordsForWipeLocked(userHandle); - int max = strictestAdmin.maximumFailedPasswordsForWipe; + int max = strictestAdmin != null + ? strictestAdmin.maximumFailedPasswordsForWipe : 0; if (max > 0 && policy.mFailedPasswordAttempts >= max) { // Wipe the user/profile associated with the policy that was violated. This // is not necessarily calling user: if the policy that fired was from a