From 03fb3355b4e8bd22d4161d8fae5d9e5ae45f2c4e Mon Sep 17 00:00:00 2001 From: Julian Schacher Date: Mon, 5 Jul 2021 10:06:51 +0200 Subject: [PATCH] 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. --- src/extension.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extension.js b/src/extension.js index ce8b341..44ee11e 100644 --- a/src/extension.js +++ b/src/extension.js @@ -353,6 +353,7 @@ class Extension { // First get the role associated with the current indicator // container. const associatedRole = indicatorContainerRoleMap.get(indicatorContainer); + if (!associatedRole) continue; // Handle an AppIndicator/KStatusNotifierItem item differently. if (associatedRole.startsWith("appindicator-")) {