Fix: Extension crashing, when no associatedRole can be found

There are situations, where no `associatedRole` for a given
`indicatorContainer` can be found (e.g. the GameMode GNOME Shell
Extension seems to cause such a situation, when you have it enabled and
lock and unlock GNOME).
Previously this would crash the extension. With this fix, those
`indicatorContainer`s just get ignored.
This commit is contained in:
Julian 2021-07-05 10:06:51 +02:00
parent e76b24e813
commit 03fb3355b4
Signed by: julian
GPG Key ID: 094C2AC34192FA11

View File

@ -353,6 +353,7 @@ class Extension {
// First get the role associated with the current indicator // First get the role associated with the current indicator
// container. // container.
const associatedRole = indicatorContainerRoleMap.get(indicatorContainer); const associatedRole = indicatorContainerRoleMap.get(indicatorContainer);
if (!associatedRole) continue;
// Handle an AppIndicator/KStatusNotifierItem item differently. // Handle an AppIndicator/KStatusNotifierItem item differently.
if (associatedRole.startsWith("appindicator-")) { if (associatedRole.startsWith("appindicator-")) {