diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-08-15 22:22:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-15 22:22:45 +0200 |
| commit | 2cbc1e6f3e6137be74e20797540cb35c10e4eb65 (patch) | |
| tree | f873ad08a2b3403d855a6670e160e4d516d0d050 /Source/Core/InputCommon/ControllerInterface/Android/Android.cpp | |
| parent | 98592b460ec3dfbfe1f29a8cc04089511b85d6e2 (diff) | |
| parent | 1d77bddc3b4090ebc4541375bf4caef18e3b6868 (diff) | |
Merge pull request #12109 from JosJuice/android-adddevice-null
ControllerInterface/Android: Add null check to AddDevice
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Android/Android.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Android/Android.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp index 1fa4f1c42b..50858cd3de 100644 --- a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp @@ -908,6 +908,12 @@ static void AddDevice(JNIEnv* env, int device_id) jobject input_device = env->CallStaticObjectMethod(s_input_device_class, s_input_device_get_device, device_id); + if (!input_device) + { + ERROR_LOG_FMT(CONTROLLERINTERFACE, "Could not find device with ID {}", device_id); + return; + } + auto device = std::make_shared<AndroidDevice>(env, input_device); env->DeleteLocalRef(input_device); |
