1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Merge pull request #33061 from madmiraal/nullpointerdereference

Call CRASH_COND_MSG if key not found in HashMap get(key) functions.
This commit is contained in:
Rémi Verschelde
2020-07-01 18:20:23 +02:00
committed by GitHub

View File

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