summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2023-01-29 02:23:55 +0100
committerGitHub <noreply@github.com>2023-01-29 02:23:55 +0100
commit9420116f6caf47319167c94ed2b3c1d4342df022 (patch)
tree83bd7f43f07dfac0de5f04b3c0faa428372a2fc1 /modules/gdscript/gdscript.cpp
parent23b622539aa612bee4ecb3115009995b7f60fb30 (diff)
parentaee7b7363b206678816272f1bd43b192cdc7d12a (diff)
Merge pull request #72286 from vnen/gdscript-native-static-call-crash
GDScript: Avoid calling non-static methods on native classes
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r--modules/gdscript/gdscript.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 4fc3929bbd..d9b8a540c0 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -98,7 +98,7 @@ Variant GDScriptNativeClass::callp(const StringName &p_method, const Variant **p
return Object::callp(p_method, p_args, p_argcount, r_error);
}
MethodBind *method = ClassDB::get_method(name, p_method);
- if (method) {
+ if (method && method->is_static()) {
// Native static method.
return method->call(nullptr, p_args, p_argcount, r_error);
}