diff --git a/cocos2dx/cocoa/CCDictionary.cpp b/cocos2dx/cocoa/CCDictionary.cpp index 64a0c11fd6..9bd909e4f3 100644 --- a/cocos2dx/cocoa/CCDictionary.cpp +++ b/cocos2dx/cocoa/CCDictionary.cpp @@ -93,10 +93,11 @@ CCObject* CCDictionary::objectForKey(const std::string& key) { if (m_eDictType != kCCDictStr) { - CCAssert(m_eDictType == kCCDictStr, "this dictionary does not use string as key."); return NULL; } + CCAssert(m_eDictType == kCCDictStr, "this dictionary does not use string as key."); + CCObject* pRetObject = NULL; CCDictElement *pElement = NULL; HASH_FIND_STR(m_pElements, key.c_str(), pElement); @@ -111,10 +112,11 @@ CCObject* CCDictionary::objectForKey(int key) { if (m_eDictType != kCCDictInt) { - CCAssert(m_eDictType == kCCDictInt, "this dictionary does not use integer as key."); return NULL; } + CCAssert(m_eDictType == kCCDictInt, "this dictionary does not use integer as key."); + CCObject* pRetObject = NULL; CCDictElement *pElement = NULL; HASH_FIND_INT(m_pElements, &key, pElement);