android: check if activity is null before using it to show/hide keyboard

tentative fix for MINIDUMP-Z
This commit is contained in:
Flyinghead 2022-12-31 16:53:08 +01:00
parent cf514b0d6b
commit 7372df3aff
1 changed files with 2 additions and 0 deletions

View File

@ -545,6 +545,8 @@ extern "C" JNIEXPORT void JNICALL Java_com_reicast_emulator_periph_InputDeviceMa
keyboard = std::make_shared<AndroidKeyboard>();
GamepadDevice::Register(keyboard);
gui_setOnScreenKeyboardCallback([](bool show) {
if (g_activity == nullptr)
return;
JNIEnv *env = jvm_attacher.getEnv();
if (show != env->CallBooleanMethod(g_activity, isScreenKeyboardShownMid))
{