Fix issues with none existing resources in apple BundledResourceLoader
This commit is contained in:
@@ -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 {};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user