summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2020-04-13 08:14:16 -0400
committerPliable Pixels <pliablepixels@gmail.com>2020-04-13 08:14:16 -0400
commitd292a9318d8adcfa86b62e8909f8ea13d5816227 (patch)
treeecca161557cc42cf490f17eefff5dd925d650c60
parent081575af2fbc06408ee9e034c573e0ad518d9444 (diff)
put some more boundary checks for notifications
-rw-r--r--www/js/EventServer.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/www/js/EventServer.js b/www/js/EventServer.js
index 2ade604d..20642c1c 100644
--- a/www/js/EventServer.js
+++ b/www/js/EventServer.js
@@ -654,7 +654,7 @@ angular.module('zmApp.controllers')
return;
}
- if (data.additionalData.foreground == false) {
+ if (data && data.additionalData && data.additionalData.foreground == false) {
// This means push notification tap in background
NVR.debug("EventSever: PUSH NOTF >>> " + JSON.stringify(data));
@@ -688,10 +688,13 @@ angular.module('zmApp.controllers')
// if Multiple mids, take the first one
- var mi = mid.indexOf(',');
- if (mi > 0) {
- mid = mid.slice(0, mi);
+ if (mid) {
+ var mi = mid.indexOf(',');
+ if (mi > 0) {
+ mid = mid.slice(0, mi);
+ }
}
+
mid = parseInt(mid);
$rootScope.tappedMid = mid;