]> arthur.barton.de Git - netdata.git/commitdiff
additional checks for detecting demo and when downloading charts #261
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 18 Apr 2016 09:49:17 +0000 (12:49 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 18 Apr 2016 09:49:17 +0000 (12:49 +0300)
web/dashboard.js
web/index.html

index 16f578f1f2f4871623062eb97a488486ba51c8c9..df258fca154706ec8dc016308d678622d9cbc189 100644 (file)
                                cache: false
                        })
                        .done(function(data) {
-                               var h = NETDATA.chartRegistry.fixid(host);
-                               //console.log('downloaded all charts from ' + host + ' (' + h + ')');
-                               self.charts[h] = data.charts;
+                               if(data !== null) {
+                                       var h = NETDATA.chartRegistry.fixid(host);
+                                       //console.log('downloaded all charts from ' + host + ' (' + h + ')');
+                                       self.charts[h] = data.charts;
+                               }
                                if(typeof callback === 'function')
                                        callback(data);
                        })
index 9da4f0e5ed745059b20318b78083110e9cd2379a..79414171bf2844c94b5c4f699b0f475e27b55220 100644 (file)
 var this_is_demo = null;
 function isdemo() {
        if(this_is_demo !== null) return this_is_demo;
-       this_is_demo = document.location.hostname.endsWith('.firehol.org');
+       this_is_demo = false;
+
+       try {
+               if(typeof document.location.hostname === 'string')
+                       this_is_demo = document.location.hostname.endsWith('.firehol.org');
+       }
+       catch(error) {
+               ;
+       }
+
        return this_is_demo;
 }