Skip to content

Commit

Permalink
Fix crash when is keyword is tested against a String variable
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyqiu committed Jan 14, 2022
1 parent e00a6d2 commit 8a42ab7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/gdscript/gdscript_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8a42ab7

Please sign in to comment.