From 6f5e5672bb9453c0cafd954993ec84a0b75b2696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 26 Oct 2012 12:34:45 +0200 Subject: [PATCH] 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 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js index 939abbb48..bdfa465d3 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');