mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-12-18 00:35:17 +00:00
registered_cache: Prevent nullptr dereference when accumulating files
For whatever reason, nca_file/dir can be nullptr in the list of files/dirs. I have not determined the cause of this yet, so add a nullptr check for these prior to dereferencing them.
This commit is contained in:
parent
7382e7a5c8
commit
ea7a0d4652
|
@ -387,15 +387,17 @@ std::vector<NcaID> RegisteredCache::AccumulateFiles() const {
|
|||
continue;
|
||||
|
||||
for (const auto& nca_dir : d2_dir->GetSubdirectories()) {
|
||||
if (!FollowsNcaIdFormat(nca_dir->GetName()))
|
||||
if (nca_dir == nullptr || !FollowsNcaIdFormat(nca_dir->GetName())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ids.push_back(Common::HexStringToArray<0x10, true>(nca_dir->GetName().substr(0, 0x20)));
|
||||
}
|
||||
|
||||
for (const auto& nca_file : d2_dir->GetFiles()) {
|
||||
if (!FollowsNcaIdFormat(nca_file->GetName()))
|
||||
if (nca_file == nullptr || !FollowsNcaIdFormat(nca_file->GetName())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ids.push_back(
|
||||
Common::HexStringToArray<0x10, true>(nca_file->GetName().substr(0, 0x20)));
|
||||
|
|
Loading…
Reference in a new issue