backgroundApps: Don't crash if app id can't be looked up

I'm looking at a log file with this trace back:

    JS ERROR: TypeError: a.app is null
              _sync/<@resource:///org/gnome/shell/ui/status/backgroundApps.js:226:17
              _sync@resource:///org/gnome/shell/ui/status/backgroundApps.js:225:14
              _init/</<@resource:///org/gnome/shell/ui/status/backgroundApps.js:170:67
              @resource:///org/gnome/shell/ui/init.js:21:20

This commit should avoid the failure by filtering out items where
lookup_app fails.
This commit is contained in:
Ray Strode 2023-09-06 09:23:51 -04:00
parent 215282a320
commit e442e9daf6

View file

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