Merge "Add a missing null check."

This commit is contained in:
Santos Cordon
2017-03-10 02:26:00 +00:00
committed by Android (Google) Code Review

View File

@@ -156,7 +156,7 @@ class CompatibilityDisplay {
mVirtualDisplay = mDisplayManager.createVirtualDisplay("VR 2D Display", WIDTH, HEIGHT,
DPI, null /* Surface */, 0 /* flags */);
if (mSurface != null && mSurface.isValid()) {
if (mVirtualDisplay != null && mSurface != null && mSurface.isValid()) {
// TODO: Need to protect all setSurface calls with a lock.
mVirtualDisplay.setSurface(mSurface);
}