summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-31 12:46:07 +0200
committerGitHub <noreply@github.com>2021-05-31 12:46:07 +0200
commit652a9debadfc80db54c4d75686f9f24ea6bac28b (patch)
treef313cbf815eef7770dc13659ef68f3d7935bc2cf
parentafe776c19e0799f949f28058b2425d9f36c39ad6 (diff)
parent4b258925012a56eaa9d19bfbca101392f4b81490 (diff)
Merge pull request #49191 from pfertyk/issue-46020-pluginscript-instance-has-crashes-godot
Check for _language in PluginScript.instance_has
-rw-r--r--modules/gdnative/pluginscript/pluginscript_script.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp
index 93fe3b3992..a48245814f 100644
--- a/modules/gdnative/pluginscript/pluginscript_script.cpp
+++ b/modules/gdnative/pluginscript/pluginscript_script.cpp
@@ -212,6 +212,8 @@ ScriptInstance *PluginScript::instance_create(Object *p_this) {
}
bool PluginScript::instance_has(const Object *p_this) const {
+ ERR_FAIL_COND_V(!_language, false);
+
_language->lock();
bool hasit = _instances.has((Object *)p_this);
_language->unlock();