diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index 1a5faa43a..df9e0c434 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp | |||
| @@ -176,11 +176,14 @@ VirtualDir XCI::GetParentDirectory() const { | |||
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) { | 178 | Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) { |
| 179 | if (partitions[static_cast<std::size_t>(part)] == nullptr) { | 179 | const auto partition_index = static_cast<std::size_t>(part); |
| 180 | const auto& partition = partitions[partition_index]; | ||
| 181 | |||
| 182 | if (partition == nullptr) { | ||
| 180 | return Loader::ResultStatus::ErrorXCIMissingPartition; | 183 | return Loader::ResultStatus::ErrorXCIMissingPartition; |
| 181 | } | 184 | } |
| 182 | 185 | ||
| 183 | for (const VirtualFile& file : partitions[static_cast<std::size_t>(part)]->GetFiles()) { | 186 | for (const VirtualFile& file : partition->GetFiles()) { |
| 184 | if (file->GetExtension() != "nca") { | 187 | if (file->GetExtension() != "nca") { |
| 185 | continue; | 188 | continue; |
| 186 | } | 189 | } |
| @@ -197,7 +200,7 @@ Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) { | |||
| 197 | } else { | 200 | } else { |
| 198 | const u16 error_id = static_cast<u16>(nca->GetStatus()); | 201 | const u16 error_id = static_cast<u16>(nca->GetStatus()); |
| 199 | LOG_CRITICAL(Loader, "Could not load NCA {}/{}, failed with error code {:04X} ({})", | 202 | LOG_CRITICAL(Loader, "Could not load NCA {}/{}, failed with error code {:04X} ({})", |
| 200 | partition_names[static_cast<std::size_t>(part)], nca->GetName(), error_id, | 203 | partition_names[partition_index], nca->GetName(), error_id, |
| 201 | nca->GetStatus()); | 204 | nca->GetStatus()); |
| 202 | } | 205 | } |
| 203 | } | 206 | } |