Avoid an assert for empty icon files in the store (should look into this more)

This commit is contained in:
Henrik Rydgård 2023-07-20 19:10:24 +02:00
parent f13a07f19b
commit 4a416174b1

View file

@ -62,7 +62,11 @@ public:
if (download.ResultCode() == 200) {
std::string data;
download.buffer().TakeAll(&data);
g_iconCache.InsertIcon(path_, IconFormat::PNG, std::move(data));
if (!data.empty()) {
g_iconCache.InsertIcon(path_, IconFormat::PNG, std::move(data));
} else {
g_iconCache.Cancel(path_);
}
} else {
g_iconCache.Cancel(path_);
}