From 16ca7a21a7c39406aa27dfa46357e9e5c4197e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 30 Jun 2019 01:04:32 +0200 Subject: [PATCH] panel: Relax check for existing signal handler Object.prototype.hasOwnProperty() is more precise than checking for falsiness, for instance the following is true: { foo: undefined }.hasOwnProperty('foo'); However when checking for a handler ID, a more relaxed check is more appropriate, as particularly 0 is not a valid handler ID. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626 --- js/ui/panel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/panel.js b/js/ui/panel.js index fcb51950f..6b8e60b19 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -1167,7 +1167,7 @@ class Panel extends St.Widget { } _onMenuSet(indicator) { - if (!indicator.menu || indicator.menu.hasOwnProperty('_openChangedId')) + if (!indicator.menu || indicator.menu._openChangedId) return; indicator.menu._openChangedId = indicator.menu.connect('open-state-changed',