Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #12109 from JosJuice/android-adddevice-null
ControllerInterface/Android: Add null check to AddDevice
  • Loading branch information
AdmiralCurtiss committed Aug 15, 2023
2 parents 98592b4 + 1d77bdd commit 2cbc1e6
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -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);
Expand Down

0 comments on commit 2cbc1e6

Please sign in to comment.