Fix possible property access on undefined object
PopupMenuManager allows the insertion of menu without a sourceActor (or with a null one), but never checks before calling contains() on it. https://bugzilla.gnome.org/show_bug.cgi?id=622730
This commit is contained in:
parent
13a1175792
commit
4aa80105ca
@ -499,13 +499,14 @@ PopupMenuManager.prototype = {
|
||||
let src = event.get_source();
|
||||
return this._activeMenu != null
|
||||
&& (this._activeMenu.actor.contains(src) ||
|
||||
this._activeMenu.sourceActor.contains(src));
|
||||
(this._activeMenu.sourceActor && this._activeMenu.sourceActor.contains(src)));
|
||||
},
|
||||
|
||||
_eventIsOnAnyMenuSource: function(event) {
|
||||
let src = event.get_source();
|
||||
for (let i = 0; i < this._menus.length; i++) {
|
||||
if (this._menus[i].sourceActor.contains(src))
|
||||
let menu = this._menus[i];
|
||||
if (menu.sourceActor && menu.sourceActor.contains(src))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user