diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2015-10-29 20:17:58 -0700 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2015-10-29 20:19:02 -0700 |
commit | 6154222f88fe6702906f34ae213282dc198be32a (patch) | |
tree | 18fe19ec5165cf0e4179543f8543299d5b764a39 /src/core/basetypes | |
parent | 2ab0504c1ec9e4d7e4512f963effe6f3ac18e713 (diff) |
Don't crash when removing a nil key from a hashmap
Diffstat (limited to 'src/core/basetypes')
-rw-r--r-- | src/core/basetypes/MCHashMap.cpp | 4 |
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; |