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

Commit 3e6ff9ae authored by Lin Ma's avatar Lin Ma Committed by Adnan Begovic
Browse files

Settings: Fix a crash caused by null pointer

* findPreference(KEY_ALLOW_LIGHTS) may return NULL

TICKET: CYNGNOS-891
Change-Id: I4111694c3f59a69a04ab00744b183048789785d5
(cherry picked from commit 9405ef9f)
parent 16aaaea4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -348,7 +348,8 @@ public class ZenModeSettings extends SettingsPreferenceFragment implements Index

            // Remove of the "Allow notification light" setting if an led is not supported
            if (!getResources().getBoolean(
                    com.android.internal.R.bool.config_intrusiveNotificationLed)) {
                    com.android.internal.R.bool.config_intrusiveNotificationLed) &&
                    findPreference(KEY_ALLOW_LIGHTS) != null) {
                downtime.removePreference(findPreference(KEY_ALLOW_LIGHTS));
            }
        }