summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Android/Android.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Android/Android.cpp6
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);