From 836fabb4941c2307ebe3671b741ea75cf350746b Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sat, 3 Aug 2024 11:58:18 +0200 Subject: [PATCH] Fix issues with none existing resources in apple BundledResourceLoader --- openVulkanoCpp/Host/Apple/BundledResoureLoaderIos.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openVulkanoCpp/Host/Apple/BundledResoureLoaderIos.mm b/openVulkanoCpp/Host/Apple/BundledResoureLoaderIos.mm index a6e04ec..603dacb 100644 --- a/openVulkanoCpp/Host/Apple/BundledResoureLoaderIos.mm +++ b/openVulkanoCpp/Host/Apple/BundledResoureLoaderIos.mm @@ -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 {}; } }