From c353914dd081c243d8d9a2b0670a35ed19c94cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 29 Jan 2019 22:43:41 +0100 Subject: [PATCH] appFavorites: Fix nonsense condition The "in" operator has a lower precedence than negation, so we are actually testing whether the favorites map contains "false". Add parentheses to get the intended behavior. Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375 --- js/ui/appFavorites.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/appFavorites.js b/js/ui/appFavorites.js index 0bdf41b22..cc3e3c32a 100644 --- a/js/ui/appFavorites.js +++ b/js/ui/appFavorites.js @@ -153,7 +153,7 @@ class AppFavorites { } _removeFavorite(appId) { - if (!appId in this._favorites) + if (!(appId in this._favorites)) return false; let ids = this._getIds().filter(id => id != appId);