Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fce93f2e authored by kaiyiz's avatar kaiyiz Committed by Brint E. Kriebel
Browse files

DeskClock: Fix DeskClock crash when click dismiss clock

It is the NullPointerException which cause this crash happen

Add a condition to exclude the NullPointerException.

CRs-fixed: 650830

Change-Id: Id45a1ce757dc1876f56bd5d49ba5376760ec4cb8
parent ff44b7ac
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -787,7 +787,11 @@ public final class AlarmStateManager extends BroadcastReceiver {
            Uri uri = intent.getData();
            AlarmInstance instance = AlarmInstance.getInstance(context.getContentResolver(),
                    AlarmInstance.getId(uri));

            if (instance == null) {
                // Not a big deal, but it shouldn't happen
                Log.e("Can not show and dismiss alarm for unknown instance: " + uri);
                return;
            }
            long alarmId = instance.mAlarmId == null ? Alarm.INVALID_ID : instance.mAlarmId;
            Intent viewAlarmIntent = Alarm.createIntent(context, DeskClock.class, alarmId);
            viewAlarmIntent.putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.ALARM_TAB_INDEX);