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

Commit b3c6e602 authored by Lyn's avatar Lyn
Browse files

Add null check for entry key

Fixes: 341929079
Test: StackScrollAlgorithmTest
Change-Id: Ib235e8ab8a5ba7db4c54e5def1e138698827719e
parent 6e3eae76
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -401,6 +401,7 @@ public class StackScrollAlgorithm {
    public boolean isCyclingOut(ExpandableNotificationRow row, AmbientState ambientState) {
    public boolean isCyclingOut(ExpandableNotificationRow row, AmbientState ambientState) {
        if (!NotificationHeadsUpCycling.isEnabled()) return false;
        if (!NotificationHeadsUpCycling.isEnabled()) return false;
        if (row.getEntry() == null) return false;
        if (row.getEntry() == null) return false;
        if (row.getEntry().getKey() == null) return false;
        String cyclingOutKey = ambientState.getAvalanchePreviousHunKey();
        String cyclingOutKey = ambientState.getAvalanchePreviousHunKey();
        return row.getEntry().getKey().equals(cyclingOutKey);
        return row.getEntry().getKey().equals(cyclingOutKey);
    }
    }
@@ -411,6 +412,7 @@ public class StackScrollAlgorithm {
    public boolean isCyclingIn(ExpandableNotificationRow row, AmbientState ambientState) {
    public boolean isCyclingIn(ExpandableNotificationRow row, AmbientState ambientState) {
        if (!NotificationHeadsUpCycling.isEnabled()) return false;
        if (!NotificationHeadsUpCycling.isEnabled()) return false;
        if (row.getEntry() == null) return false;
        if (row.getEntry() == null) return false;
        if (row.getEntry().getKey() == null) return false;
        String cyclingInKey = ambientState.getAvalancheShowingHunKey();
        String cyclingInKey = ambientState.getAvalancheShowingHunKey();
        return row.getEntry().getKey().equals(cyclingInKey);
        return row.getEntry().getKey().equals(cyclingInKey);
    }
    }