diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2020-04-13 08:14:16 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2020-04-13 08:14:16 -0400 |
| commit | d292a9318d8adcfa86b62e8909f8ea13d5816227 (patch) | |
| tree | ecca161557cc42cf490f17eefff5dd925d650c60 /www/js/EventServer.js | |
| parent | 081575af2fbc06408ee9e034c573e0ad518d9444 (diff) | |
put some more boundary checks for notifications
Diffstat (limited to 'www/js/EventServer.js')
| -rw-r--r-- | www/js/EventServer.js | 11 |
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; |
