Protect against work conditional crash

Change-Id: Iba6e7281c622e3ba34fa6bd4672b2380b0329808
Fixes: 30014085
This commit is contained in:
Jason Monk
2016-07-19 14:22:14 -04:00
parent 62edbf484e
commit 31678f14e9

View File

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