mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1063859 - Do not iterate on undefined valued when querying notifications. r=mhenretty
When we are performing the getAll/getAllCrossOrigin requests and there is no notifications, then this.notifications[origin] (with a valid origin) is just undefined. We should make sure we do not iterate over in this case.
This commit is contained in:
parent
010cc23678
commit
e459dbc542
@ -293,8 +293,10 @@ let NotificationDB = {
|
||||
var origin = data.origin;
|
||||
var notifications = [];
|
||||
// Grab only the notifications for specified origin.
|
||||
for (var i in this.notifications[origin]) {
|
||||
notifications.push(this.notifications[origin][i]);
|
||||
if (this.notifications[origin]) {
|
||||
for (var i in this.notifications[origin]) {
|
||||
notifications.push(this.notifications[origin][i]);
|
||||
}
|
||||
}
|
||||
return Promise.resolve(notifications);
|
||||
},
|
||||
@ -303,6 +305,10 @@ let NotificationDB = {
|
||||
if (DEBUG) { debug("Task, getting all whatever origin"); }
|
||||
var notifications = [];
|
||||
for (var origin in this.notifications) {
|
||||
if (!this.notifications[origin]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (var i in this.notifications[origin]) {
|
||||
var notification = this.notifications[origin][i];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user