diff --git a/src/android/app/src/main/jni/emu_window/emu_window.cpp b/src/android/app/src/main/jni/emu_window/emu_window.cpp index 26cd2da56..881e54ece 100644 --- a/src/android/app/src/main/jni/emu_window/emu_window.cpp +++ b/src/android/app/src/main/jni/emu_window/emu_window.cpp @@ -25,9 +25,10 @@ bool EmuWindow_Android::OnSurfaceChanged(ANativeWindow* surface) { render_window = surface; window_info.type = Frontend::WindowSystemType::Android; window_info.render_surface = surface; - window_width = ANativeWindow_getWidth(surface); - window_height = ANativeWindow_getHeight(surface); - + if (surface != nullptr) { + window_width = ANativeWindow_getWidth(surface); + window_height = ANativeWindow_getHeight(surface); + } StopPresenting(); OnFramebufferSizeChanged(); return true;