Merge pull request #49191 from pfertyk/issue-46020-pluginscript-instance-has-crashes-godot

Check for _language in PluginScript.instance_has
This commit is contained in:
Rémi Verschelde 2021-05-31 12:46:07 +02:00 committed by GitHub
commit 652a9debad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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();