diff options
author | Linus Groh <mail@linusgroh.de> | 2021-03-27 16:17:52 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-27 19:43:36 +0100 |
commit | e8aa998cdcb64629fc615d03d0ba08f02424e931 (patch) | |
tree | 70e264d708d73603c71469ba5b4f80a471dc0b6c /Userland/Libraries | |
parent | 9c141d0a876b5dc7660346d216e74b773e1656f6 (diff) | |
download | serenity-e8aa998cdcb64629fc615d03d0ba08f02424e931.zip |
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibGUI/FileIconProvider.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/FileIconProvider.cpp b/Userland/Libraries/LibGUI/FileIconProvider.cpp index a56d638699..ac20948f1e 100644 --- a/Userland/Libraries/LibGUI/FileIconProvider.cpp +++ b/Userland/Libraries/LibGUI/FileIconProvider.cpp @@ -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)); } auto target_icon = icon_for_path(target_path); + if (target_icon.sizes().is_empty()) + return s_symlink_icon; Icon generated_icon; for (auto size : target_icon.sizes()) { |