Fix crash when `is` keyword is tested against a String variable

(cherry picked from commit 8a42ab7a85)
This commit is contained in:
Haoyu Qiu 2022-01-14 23:34:59 +08:00 committed by Rémi Verschelde
parent a47188f2ce
commit d1c6673631
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -473,7 +473,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
err_text = "Left operand of 'is' was already freed.";
OPCODE_BREAK;
}
if (b->is_invalid_object()) {
if (b->get_type() != Variant::OBJECT || b->is_invalid_object()) {
err_text = "Right operand of 'is' is not a class.";
OPCODE_BREAK;
}