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

Commit 3cb6fc42 authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Fix NPE in DesktopAppCompatAspectRatioPolicy

task#mDisplayContent can be null when the task gets added/removed,
so a null check is needed when accessing it.

Flag: EXEMPT trivial NPE fix
Bug: 417575795
Test: m
Change-Id: Ifd3267f0deebe88f1cbf6ddf8a03cb928312d175
parent 0c94d28f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ public class DesktopAppCompatAspectRatioPolicy {
        final DisplayContent dc = task.mDisplayContent;
        final int windowingMode = task.getDisplayArea().getWindowingMode();
        return WindowConfiguration.inMultiWindowMode(windowingMode)
                && !dc.getIgnoreOrientationRequest();
                && dc != null && !dc.getIgnoreOrientationRequest();
    }

    /**
@@ -299,6 +299,7 @@ public class DesktopAppCompatAspectRatioPolicy {
        return mAppCompatOverrides.getAspectRatioOverrides()
                    .getAllowUserAspectRatioOverridePropertyValue()
                && mAppCompatConfiguration.isUserAppAspectRatioSettingsEnabled()
                && task.mDisplayContent != null
                && task.mDisplayContent.getIgnoreOrientationRequest();
    }