Commit 8a96948e authored by Erik Reider's avatar Erik Reider

Fixed notification trying to set icon from invalid .desktop file

parent 75e7363f
...@@ -440,9 +440,12 @@ namespace SwayNotificationCenter { ...@@ -440,9 +440,12 @@ namespace SwayNotificationCenter {
if (param.desktop_entry != null) { if (param.desktop_entry != null) {
string entry = param.desktop_entry; string entry = param.desktop_entry;
entry = entry.replace (".desktop", ""); entry = entry.replace (".desktop", "");
var entry_info = new DesktopAppInfo ( DesktopAppInfo entry_info = new DesktopAppInfo (
"%s.desktop".printf (entry)); "%s.desktop".printf (entry));
icon = entry_info.get_icon (); // Checks if the .desktop file actually exists or not
if (entry_info is DesktopAppInfo) {
icon = entry_info.get_icon ();
}
} }
if (icon != null) { if (icon != null) {
img.set_from_gicon (icon, icon_size); img.set_from_gicon (icon, icon_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment