Call CRASH_COND_MSG if key not found in HashMap get function.

This commit is contained in:
Marcel Admiraal 2019-10-25 14:20:01 +02:00
parent 719609522a
commit 1b05f449f0

View file

@ -280,13 +280,13 @@ public:
const TData &get(const TKey &p_key) const { const TData &get(const TKey &p_key) const {
const TData *res = getptr(p_key); const TData *res = getptr(p_key);
ERR_FAIL_COND_V(!res, *res); CRASH_COND_MSG(!res, "Map key not found.");
return *res; return *res;
} }
TData &get(const TKey &p_key) { TData &get(const TKey &p_key) {
TData *res = getptr(p_key); TData *res = getptr(p_key);
ERR_FAIL_COND_V(!res, *res); CRASH_COND_MSG(!res, "Map key not found.");
return *res; return *res;
} }