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
This commit is contained in:
Florian Müllner 2012-10-26 12:34:45 +02:00
parent dca925e40b
commit 123d6e1ef6

View File

@ -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');