Browse Source

Merge pull request #33061 from madmiraal/nullpointerdereference

Call CRASH_COND_MSG if key not found in HashMap get(key) functions.
Rémi Verschelde 5 years ago
parent
commit
6cf416dafc
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/hash_map.h

+ 2 - 2
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;
 	}