[cocos2d-x] Closes #472, fail gracefully if file is not found

This commit is contained in:
badlogic 2016-07-18 15:08:45 +02:00
parent f4f4c3ee91
commit 1c192cc3fb

View File

@ -77,6 +77,7 @@ void _spAtlasPage_disposeTexture (spAtlasPage* self) {
char* _spUtil_readFile (const char* path, int* length) {
Data data = FileUtils::getInstance()->getDataFromFile(
FileUtils::getInstance()->fullPathForFilename(path).c_str());
if (data.isNull()) return 0;
*length = data.getSize();
char* bytes = MALLOC(char, *length);
memcpy(bytes, data.getBytes(), *length);