diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-09 22:00:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-09 22:00:04 +0200 |
commit | b61a496aa7d8eee0bb5505bf99ae9e8f447b9c0d (patch) | |
tree | e091d3f763185bba2df2f7645868b4f25399a05d /modules/gdscript | |
parent | cf0953fefa3683006f88b42227efcdec22626996 (diff) | |
parent | 9f6b20936e504b7d2cdb0a6fe9d7b3c33dd4ea86 (diff) |
Merge pull request #38357 from ThakeeNathees/dict2inst-crash-fix
fix: dict2inst crash when constructor has arguments
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_functions.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index 0199af642f..85a5d86ca0 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -1199,6 +1199,11 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ } r_ret = gdscr->_new(nullptr, -1 /*skip initializer*/, r_error); + if (r_error.error != Callable::CallError::CALL_OK) { + r_ret = Variant(); + return; + } + GDScriptInstance *ins = static_cast<GDScriptInstance *>(static_cast<Object *>(r_ret)->get_script_instance()); Ref<GDScript> gd_ref = ins->get_script(); |