mirror of https://github.com/axmolengine/axmol.git
issues #2914:removeSpriteFramesFromFile() crashes if file doesn't exist
This commit is contained in:
parent
16fec3386b
commit
a17f141e7d
|
@ -344,7 +344,11 @@ void SpriteFrameCache::removeSpriteFramesFromFile(const char* plist)
|
|||
{
|
||||
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist);
|
||||
Dictionary* dict = Dictionary::createWithContentsOfFileThreadSafe(fullPath.c_str());
|
||||
|
||||
if (dict == nullptr)
|
||||
{
|
||||
CCLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFile: create dict by %s fail.",plist);
|
||||
return;
|
||||
}
|
||||
removeSpriteFramesFromDictionary((Dictionary*)dict);
|
||||
|
||||
// remove it from the cache
|
||||
|
|
Loading…
Reference in New Issue