prevent another javascript error when the registry is not reachable
Costa Tsaousis (ktsaou) committed
Jun 18, 2016 at 00:17 UTC
ec565bf0e8679af92463d77914e78cf3a3a886c1
1 file changed
+10
-4
web/dashboard.js
+10
-4
@@ -5644,12 +5644,18 @@
5644
data = null;
5645
}
5646
5647
- if(data === null && redirect !== null && max_redirects > 0) {
5648
- NETDATA.registry.server = redirect;
5649
- NETDATA.registry.access(max_redirects - 1, callback);
5647
+ if(data === null) {
5648
+ if(redirect !== null && max_redirects > 0) {
5649
+ NETDATA.registry.server = redirect;
5650
+ NETDATA.registry.access(max_redirects - 1, callback);
5651
+ }
5652
+ else {
5653
+ if(typeof callback === 'function')
5654
+ callback(null);
5655
+ }
5656
}
5657
else {
5652
- if(data !== null && typeof data.person_guid === 'string')
5658
+ if(typeof data.person_guid === 'string')
5659
NETDATA.registry.person_guid = data.person_guid;
5660
5661
if(typeof callback === 'function')