From 08c08bfef2f1a2bf0a806245149c3dc38d447e3a Mon Sep 17 00:00:00 2001 From: Muteem <29696635+Muteem@users.noreply.github.com> Date: Wed, 20 May 2026 16:23:30 +0800 Subject: [PATCH] Android: Fix NPE when proxy interface method has no arguments JDK contract: InvocationHandler.invoke's args parameter is null when the proxied interface method takes no arguments. The proxy handlers in AndroidRuntimePlugin used `*args` directly, which spread-deref'd null and threw NullPointerException. Signed-off-by: Muteem <29696635+Muteem@users.noreply.github.com> --- .../java/org/godotengine/godot/plugin/AndroidRuntimePlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/android/java/lib/src/main/java/org/godotengine/godot/plugin/AndroidRuntimePlugin.kt b/platform/android/java/lib/src/main/java/org/godotengine/godot/plugin/AndroidRuntimePlugin.kt index 19c9d51b1e..0c09ea383a 100644 --- a/platform/android/java/lib/src/main/java/org/godotengine/godot/plugin/AndroidRuntimePlugin.kt +++ b/platform/android/java/lib/src/main/java/org/godotengine/godot/plugin/AndroidRuntimePlugin.kt @@ -86,7 +86,7 @@ class AndroidRuntimePlugin(godot: Godot) : GodotPlugin(godot) { // Invocation for the interface single abstract method falls here and is dispatched to the // Godot [Callable]. - else -> godotCallable.call(*args) + else -> godotCallable.call(*(args ?: emptyArray())) } } } @@ -111,7 +111,7 @@ class AndroidRuntimePlugin(godot: Godot) : GodotPlugin(godot) { // Invocation for the remaining interface(s) methods falls here and is dispatched to the // Godot Object. - else -> Callable.call(godotObjectID, methodName, *args) + else -> Callable.call(godotObjectID, methodName, *(args ?: emptyArray())) } } }