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

Commit e20411b8 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Fix null checks in isInVisibleLocation.

Prevent an NPE when row is null; remove unnecessary check for viewState,
since getViewState is @NonNull.

Fix: 271467317
Test: presubmit
Change-Id: Ia8e48b993893a81f8dd3ae4584fa1f48d9120460
parent e8544a37
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -828,18 +828,16 @@ public class NotificationStackScrollLayoutController {

    private boolean isInVisibleLocation(NotificationEntry entry) {
        ExpandableNotificationRow row = entry.getRow();
        ExpandableViewState childViewState = row.getViewState();

        if (childViewState == null) {
        if (row == null) {
            return false;
        }

        ExpandableViewState childViewState = row.getViewState();
        if ((childViewState.location & ExpandableViewState.VISIBLE_LOCATIONS) == 0) {
            return false;
        }
        if (row.getVisibility() != View.VISIBLE) {
            return false;
        }
        return true;

        return row.getVisibility() == View.VISIBLE;
    }

    public boolean isViewAffectedBySwipe(ExpandableView expandableView) {