From 50d69a5a3d1203bfc289553a1522c012cd920a18 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Fri, 25 Oct 2019 14:20:01 +0200 Subject: [PATCH] Call CRASH_COND_MSG if key not found in HashMap get function. (cherry picked from commit 1b05f449f0584ff29a9f340b1c7c310a52aec7b1) --- core/hash_map.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hash_map.h b/core/hash_map.h index c9d3a690e72..9e51292f47e 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -294,14 +294,14 @@ 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; }