From 289008b2a7ebf08ec5a9020a514ab3a2ace2b50b Mon Sep 17 00:00:00 2001 From: Konstantin Date: Tue, 8 Nov 2016 12:34:26 +0000 Subject: [PATCH] more fixing for incorrectly formatted node info --- src/js/filters.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/js/filters.js b/src/js/filters.js index a01e7ed..40be828 100644 --- a/src/js/filters.js +++ b/src/js/filters.js @@ -139,19 +139,19 @@ angular.module('netStatsApp.filters', []) tmp[0] = 'pyeth'; } - if(tmp[1][0] !== 'v' && tmp[1][2] !== '.') + if(tmp[1] && tmp[1][0] !== 'v' && tmp[1][2] !== '.') { tmp.splice(1,1); } - if(tmp[2] === 'Release'){ + if(tmp[2] && tmp[2] === 'Release'){ tmp.splice(2,1); } - if(tmp[2].indexOf('Linux') === 0) + if(tmp[2] && tmp[2].indexOf('Linux') === 0) tmp[2] = 'linux'; - if(tmp[2].indexOf('Darwin') === 0) + if(tmp[2] && tmp[2].indexOf('Darwin') === 0) tmp[2] = 'darwin'; return $sce.trustAsHtml(tmp.join('/')); @@ -466,16 +466,18 @@ angular.module('netStatsApp.filters', []) if(node.info.node) { var eth_version = node.info.node.split('/'); - if(eth_version[1][0] !== 'v' && eth_version[1][2] !== '.') - { - eth_version.splice(1,1); - } + if(eth_version[1]){ + if(eth_version[1][0] !== 'v' && eth_version[1][2] !== '.') + { + eth_version.splice(1,1); + } - string = "" + node.info.node + ""; - tooltip.push(string); + string = "" + node.info.node + ""; + tooltip.push(string); - string = "Version: " + (eth_version[1]) + ""; - tooltip.push(string); + string = "Version: " + (eth_version[1]) + ""; + tooltip.push(string); + } } if(node.info.net !== '') {