Merge pull request #62921 from cdemirer/fix-variant-in

Fix `Variant::in()` error on invalid `evaluate`
This commit is contained in:
Rémi Verschelde 2023-02-13 12:59:02 +01:00
commit 4a2c2170b4
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 5 additions and 2 deletions

View File

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