Closed qarmin closed 3 years ago
I'd like to submit a fix. The PR is to master
, but it should be easy to cherry-pick to 3.x
. The only difference is that BoxShape
was renamed to BoxShape3D
, but that doesn't affect the fix :)
The problem was that _language
is null
when we invoke instance_has
. I've noticed that reload
method checks if _language
was properly initialized and throws an error otherwise, so I've repeated that solution in instance_has
.
My fix will prevent Godot from crashing. However, this does not solve the problem of _language
not being initialized. Being a fresh Godot contributor, I'm not sure where it should happen. The value is assigned in init
but I don't know whose responsability is it to call init
:) Do you think my fix is enough or should I look into it and find a way to initialize _language
correctly?
@pfertyk Your fix seems correct. PluginScript assumes that a call to init
should happen first before the rest of the API can be initialized, so using "reverse asserts" like we have with ERR_FAIL_COND
is the canonical way to prevent calling such APIs before they're initialized properly.
Godot version: Godot 3.2.4 rc 2
Issue description: Executing
crashes with backtrace