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

Commit bd47a5a5 authored by Zhao Wei Liew's avatar Zhao Wei Liew
Browse files

SoundSettings: Prevent NPE due to linked volumes change

In AOSP, mRingOrNotificationPreference can never be null.

However, ever since the linked notification volumes change
in commit 6430dbd2, there is a
possibility that mRingOrNotificationPreference is null,
causing an NPE when calling showIcon() on it.

Add a null check to prevent that.

Change-Id: I8d7231f50fc1f04acdc706e2d2c775bed7803fca
parent 2b744b74
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -275,6 +275,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements Indexab
    }

    private void updateRingOrNotificationPreference() {
        if (mRingOrNotificationPreference == null) return;
        mRingOrNotificationPreference.showIcon(mSuppressor != null
                ? com.android.internal.R.drawable.ic_audio_ring_notif_mute
                : mRingerMode == AudioManager.RINGER_MODE_VIBRATE || wasRingerModeVibrate()