[gnome-shell] Fix possible property access on undefined object
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Fix possible property access on undefined object
- Date: Tue, 20 Jul 2010 13:35:37 +0000 (UTC)
commit 4aa80105ca4469ddbcf9537eee47a067e184bc7d
Author: Giovanni Campagna <scampa giovanni gmail com>
Date: Mon Jul 19 23:27:56 2010 +0200
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
js/ui/popupMenu.js | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 8ac9ef6..2826edd 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]