From 59fafb0cd9b09ff75c87c99fdf485bec235732d0 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 25 Aug 2022 12:05:04 +0200 Subject: [PATCH] Check if a file exist when loading a RPX/WUHB --- src/RPXLoading.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/RPXLoading.cpp b/src/RPXLoading.cpp index 08a87d8..8efcbe5 100644 --- a/src/RPXLoading.cpp +++ b/src/RPXLoading.cpp @@ -129,7 +129,14 @@ RPXLoaderStatus RL_PrepareLaunchFromSD(const char *bundle_path) { bool metaLoaded = false; - std::string completePath = std::string("/vol/external01/") + bundle_path; + std::string completePath = std::string("/vol/external01/") + bundle_path; + std::string completeNewLibPath = std::string("fs:/vol/external01/") + bundle_path; + + struct stat st {}; + if (stat(completeNewLibPath.c_str(), &st) < 0) { + DEBUG_FUNCTION_LINE_ERR("Failed to prepare launch from SD, file (%s) not found.", bundle_path); + return RPX_LOADER_RESULT_NOT_FOUND; + } bool isBundle = false; auto rpxInfo = WUHBUtils_GetRPXInfo(completePath.c_str(), BundleSource_FileDescriptor_CafeOS, &fileInfo);