diff options
author | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-03-22 13:46:48 +0100 |
---|---|---|
committer | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-03-22 13:46:48 +0100 |
commit | 20b6b7d37e2ae126c9e133604634d657a026283a (patch) | |
tree | 10eff350949e54cdf347cc243ce273d2a4767643 /web/nms.gathering.org/js/nms-info-box.js | |
parent | b27bb9e30c57e8585b69c9f5747253867f5c1d85 (diff) |
NMS: Fix some infoBox content checks
Diffstat (limited to 'web/nms.gathering.org/js/nms-info-box.js')
-rw-r--r-- | web/nms.gathering.org/js/nms-info-box.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index b360beb..1a457b7 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -164,7 +164,11 @@ nmsInfoBox._windowTypes.switchInfo = { this.sw = sw; } this.swi = nmsData.switches["switches"][this.sw]; - this.swm = nmsData.smanagement.switches[this.sw]; + try { + this.swm = nmsData.smanagement.switches[this.sw]; + } catch(e) { + this.swm = []; + } var content = []; @@ -200,7 +204,7 @@ nmsInfoBox._windowTypes.switchInfo = { showComments: function() { var domObj = document.createElement("div"); var comments = []; - if (nmsData.comments.comments != undefined && nmsData.comments.comments[this.sw] != undefined) { + if(!(!nmsData.comments || !nmsData.comments.comments || !nmsData.comments.comments[this.sw])) { for (var c in nmsData.comments.comments[this.sw]["comments"]) { var comment = nmsData.comments.comments[this.sw]["comments"][c]; if (comment["state"] == "active" || comment["state"] == "persist" || comment["state"] == "inactive") { |