panel: don't break when indicator has no menu

Status indicators don't have necessarily a menu. If they have not we don't
want to add the menu in the PopupMenuManager.

https://bugzilla.gnome.org/show_bug.cgi?id=678694
This commit is contained in:
Jean-Philippe Braun 2012-06-24 10:55:46 +02:00 committed by Florian Müllner
parent b90e7eb95c
commit 9faac81a37

View File

@ -1126,7 +1126,8 @@ const Panel = new Lang.Class({
if (!position)
position = 0;
this._insertStatusItem(indicator.actor, position);
this._menus.addMenu(indicator.menu);
if (indicator.menu)
this._menus.addMenu(indicator.menu);
this._statusArea[role] = indicator;
let destroyId = indicator.connect('destroy', Lang.bind(this, function(emitter) {