Merge pull request #12109 from JosJuice/android-adddevice-null
ControllerInterface/Android: Add null check to AddDevice
This commit is contained in:
commit
2cbc1e6f3e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue