[gnome-shell] panelMenu: Fix exception when destroying menuless button



commit 6f5e5672bb9453c0cafd954993ec84a0b75b2696
Author: Florian MÃllner <fmuellner gnome org>
Date:   Fri Oct 26 12:34:45 2012 +0200

    panelMenu: Fix exception when destroying menuless button
    
    There's explicit API to create PanelMenu.Buttons with no menu, so
    guard against this case in destroy().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686763

 js/ui/panelMenu.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 939abbb..bdfa465 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -214,7 +214,8 @@ const Button = new Lang.Class({
     destroy: function() {
         this.actor._delegate = null;
 
-        this.menu.destroy();
+        if (this.menu)
+            this.menu.destroy();
         this.actor.destroy();
 
         this.emit('destroy');



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