[gnome-shell] panel: fix crash when bluetooth is disabled



commit db07aa42ea1b2a0ed702252a753122739fdcd1b2
Author: Olivier Blin <dev blino org>
Date:   Wed Sep 4 01:22:46 2013 +0200

    panel: fix crash when bluetooth is disabled
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707430

 js/ui/panel.js |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index aaabad1..c6c1abc 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -809,7 +809,12 @@ const AggregateMenu = new Lang.Class({
         this.actor.add_child(this._indicators);
 
         this._network = new imports.ui.status.network.NMApplet();
-        this._bluetooth = new imports.ui.status.bluetooth.Indicator();
+        if (Config.HAVE_BLUETOOTH) {
+            this._bluetooth = new imports.ui.status.bluetooth.Indicator();
+        } else {
+            this._bluetooth = null;
+        }
+
         this._power = new imports.ui.status.power.Indicator();
         this._rfkill = new imports.ui.status.rfkill.Indicator();
         this._volume = new imports.ui.status.volume.Indicator();
@@ -819,7 +824,9 @@ const AggregateMenu = new Lang.Class({
 
         this._indicators.add_child(this._screencast.indicators);
         this._indicators.add_child(this._network.indicators);
-        this._indicators.add_child(this._bluetooth.indicators);
+        if (this._bluetooth) {
+            this._indicators.add_child(this._bluetooth.indicators);
+        }
         this._indicators.add_child(this._rfkill.indicators);
         this._indicators.add_child(this._volume.indicators);
         this._indicators.add_child(this._power.indicators);
@@ -831,7 +838,9 @@ const AggregateMenu = new Lang.Class({
         this.menu.addMenuItem(this._brightness.menu);
         this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
         this.menu.addMenuItem(this._network.menu);
-        this.menu.addMenuItem(this._bluetooth.menu);
+        if (this._bluetooth) {
+            this.menu.addMenuItem(this._bluetooth.menu);
+        }
         this.menu.addMenuItem(this._rfkill.menu);
         this.menu.addMenuItem(this._power.menu);
         this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]