aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2015-10-29 20:17:58 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2015-10-29 20:19:02 -0700
commit6154222f88fe6702906f34ae213282dc198be32a (patch)
tree18fe19ec5165cf0e4179543f8543299d5b764a39
parent2ab0504c1ec9e4d7e4512f963effe6f3ac18e713 (diff)
Don't crash when removing a nil key from a hashmap
-rw-r--r--src/core/basetypes/MCHashMap.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/basetypes/MCHashMap.cpp b/src/core/basetypes/MCHashMap.cpp
index c56277fc..9958c502 100644
--- a/src/core/basetypes/MCHashMap.cpp
+++ b/src/core/basetypes/MCHashMap.cpp
@@ -169,6 +169,10 @@ void HashMap::removeObjectForKey(Object * key)
{
unsigned int func, indx;
HashMapIter * iter, * old;
+
+ if (key == NULL) {
+ return;
+ }
func = key->hash();;
indx = func % mAllocated;