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

Commit 9741dde4 authored by Piotr Wilczyński's avatar Piotr Wilczyński Committed by Gerrit Code Review
Browse files

Merge "Fix NPE when store brightness and displayDevice is null"

parents 6216ab81 efcb4ff2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -300,8 +300,11 @@ final class PersistentDataStore {
    }

    public boolean setBrightness(DisplayDevice displayDevice, float brightness) {
        if (displayDevice == null || !displayDevice.hasStableUniqueId()) {
            return false;
        }
        final String displayDeviceUniqueId = displayDevice.getUniqueId();
        if (!displayDevice.hasStableUniqueId() || displayDeviceUniqueId == null) {
        if (displayDeviceUniqueId == null) {
            return false;
        }
        final DisplayState state = getDisplayState(displayDeviceUniqueId, true);