Fix NPE

Apparently, this can cause an NPE when there are multiple displays.
Someone sent us
review.git.corp.google.com/c/platform/frameworks/base/+/2296938 and the problem will reoccur if we don't fix it in that code's new location.

Bug: 256539657
Test: presubmits
Change-Id: I2c08bb5606bc8af7f3da0f3034c58b5d57b1be0f
1 file changed