OSDN Git Service

Protect against work conditional crash
authorJason Monk <jmonk@google.com>
Tue, 19 Jul 2016 18:22:14 +0000 (14:22 -0400)
committerJason Monk <jmonk@google.com>
Tue, 19 Jul 2016 18:22:14 +0000 (14:22 -0400)
Change-Id: Iba6e7281c622e3ba34fa6bd4672b2380b0329808
Fixes: 30014085

src/com/android/settings/dashboard/conditional/WorkModeCondition.java

index 3d9958b..7924eef 100644 (file)
@@ -90,7 +90,9 @@ public class WorkModeCondition extends Condition {
     @Override
     public void onActionClick(int index) {
         if (index == 0) {
-            mUm.trySetQuietModeDisabled(mUserHandle.getIdentifier(), null);
+            if (mUserHandle != null) {
+                mUm.trySetQuietModeDisabled(mUserHandle.getIdentifier(), null);
+            }
             setActive(false);
         } else {
             throw new IllegalArgumentException("Unexpected index " + index);