status/backgroundApps: Filter out unknown apps

While extremely rare, flatpak apps are not guaranteed to provide
a .desktop file.

We don't have anything to represent the app in that case, but at
least we shouldn't break when trying to access properties on null,
so filter out these entries.

Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6913

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2938>
This commit is contained in:
Florian Müllner 2023-09-05 17:08:38 +02:00 committed by Marge Bot
parent 8ece56b5c2
commit 2bc4215d1d

View File

@ -226,6 +226,7 @@ class BackgroundAppsToggle extends QuickToggle {
return {app, message};
})
.filter(item => !!item.app)
.sort((a, b) => {
return a.app.get_name().localeCompare(b.app.get_name());
})