mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-07-11 01:24:22 +02:00
Merge pull request #14680 from Tilka/fs_null_fix
DolphinTool: fix crash when listing partition without filesystem
This commit is contained in:
@@ -119,6 +119,11 @@ static bool ListPartition(const DiscIO::Volume& disc_volume, const DiscIO::Parti
|
||||
std::string* result_text)
|
||||
{
|
||||
const DiscIO::FileSystem* filesystem = disc_volume.GetFileSystem(partition);
|
||||
if (!filesystem)
|
||||
{
|
||||
fmt::println(std::cerr, "Warning: partition {} has no filesystem.", partition_name);
|
||||
return false;
|
||||
}
|
||||
const std::unique_ptr<DiscIO::FileInfo> info = filesystem->FindFileInfo(path);
|
||||
|
||||
if (!info)
|
||||
@@ -167,7 +172,7 @@ static bool ListVolume(const DiscIO::Volume& disc_volume, const std::string& pat
|
||||
fmt::print(std::cout, "{}", partition_start);
|
||||
result_text->append(partition_start);
|
||||
|
||||
success |= ListPartition(disc_volume, p, specific_partition_name, path, result_text);
|
||||
success |= ListPartition(disc_volume, p, partition_name, path, result_text);
|
||||
}
|
||||
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user