You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
JavaClassWrapper: Give additional error when trying to call non-static method directly on the class
This commit is contained in:
@@ -156,6 +156,9 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!method) {
|
if (!method) {
|
||||||
|
if (r_error.error == Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL) {
|
||||||
|
ERR_PRINT(vformat(R"(Cannot call static function "%s" on Java class "%s" directly. Make an instance instead.)", p_method, java_class_name));
|
||||||
|
}
|
||||||
return true; //no version convinces
|
return true; //no version convinces
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user