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
a2b5d8654e
commit
9d98ab3d50
@ -293,8 +293,10 @@ let NotificationDB = {
|
|||||||
var origin = data.origin;
|
var origin = data.origin;
|
||||||
var notifications = [];
|
var notifications = [];
|
||||||
// Grab only the notifications for specified origin.
|
// Grab only the notifications for specified origin.
|
||||||
for (var i in this.notifications[origin]) {
|
if (this.notifications[origin]) {
|
||||||
notifications.push(this.notifications[origin][i]);
|
for (var i in this.notifications[origin]) {
|
||||||
|
notifications.push(this.notifications[origin][i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Promise.resolve(notifications);
|
return Promise.resolve(notifications);
|
||||||
},
|
},
|
||||||
@ -303,6 +305,10 @@ let NotificationDB = {
|
|||||||
if (DEBUG) { debug("Task, getting all whatever origin"); }
|
if (DEBUG) { debug("Task, getting all whatever origin"); }
|
||||||
var notifications = [];
|
var notifications = [];
|
||||||
for (var origin in this.notifications) {
|
for (var origin in this.notifications) {
|
||||||
|
if (!this.notifications[origin]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (var i in this.notifications[origin]) {
|
for (var i in this.notifications[origin]) {
|
||||||
var notification = this.notifications[origin][i];
|
var notification = this.notifications[origin][i];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user