From 775bf8e215c8c771b45f383b0b2ce46fa37ebe95 Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 16 Aug 2023 12:25:36 -0400 Subject: file_sys: tolerate empty NCA --- src/core/file_sys/card_image.cpp | 2 +- src/core/file_sys/registered_cache.cpp | 2 +- src/core/file_sys/submission_package.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index 4920905a6..3b2588c84 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp @@ -185,7 +185,7 @@ u32 XCI::GetSystemUpdateVersion() { for (const auto& update_file : update->GetFiles()) { NCA nca{update_file}; - if (nca.GetStatus() != Loader::ResultStatus::Success) { + if (nca.GetStatus() != Loader::ResultStatus::Success || nca.GetSubdirectories().empty()) { continue; } diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index e4218523a..a28af3594 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -418,7 +418,7 @@ void RegisteredCache::ProcessFiles(const std::vector& ids) { continue; const auto nca = std::make_shared(parser(file, id)); if (nca->GetStatus() != Loader::ResultStatus::Success || - nca->GetType() != NCAContentType::Meta) { + nca->GetType() != NCAContentType::Meta || nca->GetSubdirectories().empty()) { continue; } diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp index 73582ad50..e1e89ce2d 100644 --- a/src/core/file_sys/submission_package.cpp +++ b/src/core/file_sys/submission_package.cpp @@ -249,7 +249,7 @@ void NSP::ReadNCAs(const std::vector& files) { } const auto nca = std::make_shared(outer_file); - if (nca->GetStatus() != Loader::ResultStatus::Success) { + if (nca->GetStatus() != Loader::ResultStatus::Success || nca->GetSubdirectories().empty()) { program_status[nca->GetTitleId()] = nca->GetStatus(); continue; } -- cgit v1.2.3