mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 12:05:52 +00:00
GameList: Don't return nonexistant path on icon extract fail
This commit is contained in:
parent
33c0674a9f
commit
6db1dbbe02
@ -1835,11 +1835,13 @@ std::string GameList::GetGameIconPath(std::string_view serial, std::string_view
|
|||||||
std::memcpy(image.GetPixels(), &fi.icon_frames.front().pixels,
|
std::memcpy(image.GetPixels(), &fi.icon_frames.front().pixels,
|
||||||
MemoryCardImage::ICON_WIDTH * MemoryCardImage::ICON_HEIGHT * sizeof(u32));
|
MemoryCardImage::ICON_WIDTH * MemoryCardImage::ICON_HEIGHT * sizeof(u32));
|
||||||
serial_entry->icon_was_extracted = image.SaveToFile(ret.c_str());
|
serial_entry->icon_was_extracted = image.SaveToFile(ret.c_str());
|
||||||
if (!serial_entry->icon_was_extracted)
|
if (serial_entry->icon_was_extracted)
|
||||||
|
{
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ERROR_LOG("Failed to save memory card icon to {}.", ret);
|
ERROR_LOG("Failed to save memory card icon to {}.", ret);
|
||||||
ret = {};
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1849,6 +1851,7 @@ std::string GameList::GetGameIconPath(std::string_view serial, std::string_view
|
|||||||
ERROR_LOG("Failed to load memory card '{}': {}", Path::GetFileName(memcard_path), error.GetDescription());
|
ERROR_LOG("Failed to load memory card '{}': {}", Path::GetFileName(memcard_path), error.GetDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = {};
|
||||||
UpdateMemcardTimestampCache(*serial_entry);
|
UpdateMemcardTimestampCache(*serial_entry);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user