mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 13:17:43 +00:00
LibGUI: Return symlink fallback icon if target icon cannot be determined
This is the case for symlinks that point to themselves, for example - previously the returned icon would be empty. Fixes #5978. Fixes #5979.
This commit is contained in:
parent
9c141d0a87
commit
e8aa998cdc
1 changed files with 2 additions and 0 deletions
|
@ -235,6 +235,8 @@ Icon FileIconProvider::icon_for_path(const String& path, mode_t mode)
|
||||||
target_path = Core::File::real_path_for(String::formatted("{}/{}", LexicalPath(path).dirname(), raw_symlink_target));
|
target_path = Core::File::real_path_for(String::formatted("{}/{}", LexicalPath(path).dirname(), raw_symlink_target));
|
||||||
}
|
}
|
||||||
auto target_icon = icon_for_path(target_path);
|
auto target_icon = icon_for_path(target_path);
|
||||||
|
if (target_icon.sizes().is_empty())
|
||||||
|
return s_symlink_icon;
|
||||||
|
|
||||||
Icon generated_icon;
|
Icon generated_icon;
|
||||||
for (auto size : target_icon.sizes()) {
|
for (auto size : target_icon.sizes()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue