Skip to content

Commit 117b1c3

Browse files
committed
Use validated key in Dictionary::has
Updated Dictionary::has to use validated key when checking variant_map, to handle cases when passed in key is converted to Dictionary's key type.
1 parent 4248411 commit 117b1c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/variant/dictionary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ bool Dictionary::is_empty() const {
218218
bool Dictionary::has(const Variant &p_key) const {
219219
Variant key = p_key;
220220
ERR_FAIL_COND_V(!_p->typed_key.validate(key, "use 'has'"), false);
221-
return _p->variant_map.has(p_key);
221+
return _p->variant_map.has(key);
222222
}
223223

224224
bool Dictionary::has_all(const Array &p_keys) const {

0 commit comments

Comments
 (0)