aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/js/nms-info-box.js
diff options
context:
space:
mode:
authorNicolai Tellefsen <niccofyren@gmail.com>2016-03-22 13:46:48 +0100
committerNicolai Tellefsen <niccofyren@gmail.com>2016-03-22 13:46:48 +0100
commit20b6b7d37e2ae126c9e133604634d657a026283a (patch)
tree10eff350949e54cdf347cc243ce273d2a4767643 /web/nms.gathering.org/js/nms-info-box.js
parentb27bb9e30c57e8585b69c9f5747253867f5c1d85 (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.js8
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") {