Skip to content

Commit

Permalink
Merge pull request #62921 from cdemirer/fix-variant-in
Browse files Browse the repository at this point in the history
Fix `Variant::in()` error on invalid `evaluate`
  • Loading branch information
akien-mga committed Feb 13, 2023
2 parents 848c910 + 44b2747 commit 4a2c217
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/variant/variant_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1105,8 +1105,11 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const {
evaluate(OP_IN, p_index, *this, ret, valid);
if (r_valid) {
*r_valid = valid;
}
if (valid) {
ERR_FAIL_COND_V(ret.type != BOOL, false);
return *VariantGetInternalPtr<bool>::get_ptr(&ret);
} else {
return false;
}
ERR_FAIL_COND_V(ret.type != BOOL, false);
return *VariantGetInternalPtr<bool>::get_ptr(&ret);
}

0 comments on commit 4a2c217

Please sign in to comment.