소스 검색

Merge pull request #105205 from aaronp64/dictionary_has_validated_key

Use validated key in `Dictionary::has`
Thaddeus Crews 5 달 전
부모
커밋
7b74eb1a9b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      core/variant/dictionary.cpp

+ 1 - 1
core/variant/dictionary.cpp

@@ -218,7 +218,7 @@ bool Dictionary::is_empty() const {
 bool Dictionary::has(const Variant &p_key) const {
 	Variant key = p_key;
 	ERR_FAIL_COND_V(!_p->typed_key.validate(key, "use 'has'"), false);
-	return _p->variant_map.has(p_key);
+	return _p->variant_map.has(key);
 }
 
 bool Dictionary::has_all(const Array &p_keys) const {