Fix crash when is-operator right-hand-side is null

(cherry picked from commit 871a73341b)
This commit is contained in:
Haoyu Qiu 2022-03-13 23:17:25 +08:00 committed by Rémi Verschelde
parent 1f4dda2138
commit c594e1c0cc
1 changed files with 5 additions and 1 deletions

View File

@ -509,7 +509,11 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
#ifdef DEBUG_ENABLED
if (!nc) {
err_text = "Right operand of 'is' is not a class (type: '" + obj_B->get_class() + "').";
if (obj_B) {
err_text = "Right operand of 'is' is not a class (type: '" + obj_B->get_class() + "').";
} else {
err_text = "Right operand of 'is' is null.";
}
OPCODE_BREAK;
}
#endif