Merge pull request #9243 from JosJuice/android-input-overlay-null

Android: Add null check for InputOverlay
This commit is contained in:
JosJuice 2020-11-11 11:22:41 +01:00 committed by GitHub
commit 9e3e325add
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,6 +94,8 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
doneButton.setOnClickListener(v -> stopConfiguringControls());
}
if (mInputOverlay != null)
{
contents.post(() ->
{
int overlayX = mInputOverlay.getLeft();
@ -102,6 +104,7 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
surfaceView.getLeft() - overlayX, surfaceView.getTop() - overlayY,
surfaceView.getRight() - overlayX, surfaceView.getBottom() - overlayY));
});
}
// The new Surface created here will get passed to the native code via onSurfaceChanged.