Skip to content

Commit

Permalink
locations: Do not warn if a file info has not the icon attribute
Browse files Browse the repository at this point in the history
We were still getting a null icon but Gio was warning about so we
can just check if it has such attribute first.
  • Loading branch information
3v1n0 committed Apr 19, 2024
1 parent f6579c0 commit 6585266
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ export const LocationAppInfo = GObject.registerClass({
iconsQuery.join(','),
Gio.FileQueryInfoFlags.NONE,
GLib.PRIORITY_LOW, cancellable);
icons.standard = info.get_icon();
if (info.has_attribute(Gio.FILE_ATTRIBUTE_STANDARD_ICON))
icons.standard = info.get_icon();
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND) ||
e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_MOUNTED))
Expand Down

0 comments on commit 6585266

Please sign in to comment.