Fix issues with none existing resources in apple BundledResourceLoader

This commit is contained in:
Georg Hagen
2024-08-03 11:58:18 +02:00
parent 4daf12644a
commit 836fabb494

View File

@@ -22,9 +22,10 @@ namespace OpenVulkano
{
auto [fileName, fileType] = Utils::SplitAtLastOccurrence(resourceName, '.');
NSString* filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithUTF8String:fileName.c_str()] ofType:[NSString stringWithUTF8String:fileType.c_str()]];
return Utils::ReadFile(std::string([filePath UTF8String]));
if (filePath)
return Utils::ReadFile(std::string([filePath UTF8String]));
}
Logger::FILESYS->warn("Failed to find resource: '{}' in bundle", resourceName);
return {0};
return {};
}
}