mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
JavaClassWrapper: Give additional error when trying to call non-static method directly on the class
This commit is contained in:
parent
f0f5319b0b
commit
96bde8f221
1 changed files with 3 additions and 0 deletions
|
@ -156,6 +156,9 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue