fs: Fix nullptr check in GetFile
This commit is contained in:
parent
3b0a5aed33
commit
0dda5eb6ef
|
@ -132,8 +132,12 @@ File* HandleTable::GetFile(int d) {
|
|||
}
|
||||
|
||||
File* HandleTable::GetFile(const std::filesystem::path& host_name) {
|
||||
const auto it = std::ranges::find(m_files, host_name, &File::m_host_name);
|
||||
return it == m_files.end() ? nullptr : *it;
|
||||
for (auto* file : m_files) {
|
||||
if (file != nullptr && file->m_host_name == host_name) {
|
||||
return file;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace Core::FileSys
|
||||
|
|
Loading…
Reference in New Issue