Merge pull request #56791 from timothyqiu/object-check

[3.x] Fix crash when `is` keyword is tested against a String variable
This commit is contained in:
Rémi Verschelde 2022-01-14 20:00:56 +01:00 committed by GitHub
commit 75cc95c8c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;
}