summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-01 18:20:23 +0200
committerGitHub <noreply@github.com>2020-07-01 18:20:23 +0200
commit6cf416dafc8b3e1019f765da1e596ba4d0e44425 (patch)
tree200ea0bbff33663f03db442ebafba1c809b1e655
parent8a484756de0d66aa91da7975672234d58ca31d7d (diff)
parent1b05f449f0584ff29a9f340b1c7c310a52aec7b1 (diff)
Merge pull request #33061 from madmiraal/nullpointerdereference
Call CRASH_COND_MSG if key not found in HashMap get(key) functions.
-rw-r--r--core/hash_map.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/hash_map.h b/core/hash_map.h
index 843430d082..10fc931e7a 100644
--- a/core/hash_map.h
+++ b/core/hash_map.h
@@ -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;
}