Null check for logicaldisplay

Ensure that the logical display is valid before calling getPrimaryDisplayDeviceLocked() on it first.

Bug: 194542389
Test: Manual
Change-Id: I788527a3cd02fcc12efe0b8d84e26d5d66f53762
This commit is contained in:
Fiona Campbell
2021-07-28 18:49:59 +01:00
parent a16f9cc218
commit 245cf10867

View File

@@ -3285,6 +3285,9 @@ public final class DisplayManagerService extends SystemService {
synchronized (mSyncRoot) {
final LogicalDisplay display = mLogicalDisplayMapper.getDisplayLocked(displayId);
if (display == null) {
return null;
}
final DisplayDevice device = display.getPrimaryDisplayDeviceLocked();
if (device == null) {
return null;