[gnome-shell] bluetooth: Fix infinite loop
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] bluetooth: Fix infinite loop
- Date: Thu, 2 Apr 2020 12:16:14 +0000 (UTC)
commit 5067bda61a6a27a14aab7fa7482b8f305699cf96
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Apr 2 12:42:41 2020 +0200
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 ab167be028..04a6d5ae29 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]