From 5067bda61a6a27a14aab7fa7482b8f305699cf96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 2 Apr 2020 12:42:41 +0200 Subject: [PATCH] bluetooth: Fix infinite loop Bailing out early of the loop means the iter is never increased, resulting in an infinite loop. Fixes 26c2cb9f6. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1165 --- js/ui/status/bluetooth.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js index ab167be02..04a6d5ae2 100644 --- a/js/ui/status/bluetooth.js +++ b/js/ui/status/bluetooth.js @@ -84,15 +84,14 @@ class Indicator extends PanelMenu.SystemIndicator { const isTrusted = this._model.get_value(iter, GnomeBluetooth.Column.TRUSTED); - if (!isPaired && !isTrusted) - continue; - - deviceInfos.push({ - connected: this._model.get_value(iter, - GnomeBluetooth.Column.CONNECTED), - name: this._model.get_value(iter, - GnomeBluetooth.Column.ALIAS), - }); + if (isPaired || isTrusted) { + deviceInfos.push({ + connected: this._model.get_value(iter, + GnomeBluetooth.Column.CONNECTED), + name: this._model.get_value(iter, + GnomeBluetooth.Column.ALIAS), + }); + } ret = this._model.iter_next(iter); }