mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
get_desktop_app_info: fix crash on failed DesktopAppInfo::create
Even though it makes little sense for this call to fail, it sometimes randomly does, and takes down waybar with it.
This commit is contained in:
parent
f0bead34d4
commit
df0fdce92b
@ -102,8 +102,11 @@ Glib::RefPtr<Gio::DesktopAppInfo> get_desktop_app_info(const std::string &app_id
|
|||||||
desktop_file = desktop_list[0][i];
|
desktop_file = desktop_list[0][i];
|
||||||
} else {
|
} else {
|
||||||
auto tmp_info = Gio::DesktopAppInfo::create(desktop_list[0][i]);
|
auto tmp_info = Gio::DesktopAppInfo::create(desktop_list[0][i]);
|
||||||
auto startup_class = tmp_info->get_startup_wm_class();
|
if (!tmp_info)
|
||||||
|
// see https://github.com/Alexays/Waybar/issues/1446
|
||||||
|
continue;
|
||||||
|
|
||||||
|
auto startup_class = tmp_info->get_startup_wm_class();
|
||||||
if (startup_class == app_id) {
|
if (startup_class == app_id) {
|
||||||
desktop_file = desktop_list[0][i];
|
desktop_file = desktop_list[0][i];
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user