Skip to content

Commit 2c11fac

Browse files
committed
Merge pull request #112853 from aaronp64/dictionary_error_key
Include key in `Dictionary::operator[]` error message
2 parents 462a8d6 + c183327 commit 2c11fac

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
@@ -133,7 +133,7 @@ const Variant &Dictionary::operator[](const Variant &p_key) const {
133133
} else {
134134
static Variant empty;
135135
const Variant *value = _p->variant_map.getptr(key);
136-
ERR_FAIL_COND_V_MSG(!value, empty, "Bug: Dictionary::operator[] used when there was no value for the given key, please report.");
136+
ERR_FAIL_COND_V_MSG(!value, empty, vformat(R"(Bug: Dictionary::operator[] used when there was no value for the given key "%s". Please report.)", key));
137137
return *value;
138138
}
139139
}

0 commit comments

Comments
 (0)