Skip to content

Commit 289008b

Browse files
committed
more fixing for incorrectly formatted node info
1 parent e849a7f commit 289008b

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/js/filters.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,19 @@ angular.module('netStatsApp.filters', [])
139139
tmp[0] = 'pyeth';
140140
}
141141

142-
if(tmp[1][0] !== 'v' && tmp[1][2] !== '.')
142+
if(tmp[1] && tmp[1][0] !== 'v' && tmp[1][2] !== '.')
143143
{
144144
tmp.splice(1,1);
145145
}
146146

147-
if(tmp[2] === 'Release'){
147+
if(tmp[2] && tmp[2] === 'Release'){
148148
tmp.splice(2,1);
149149
}
150150

151-
if(tmp[2].indexOf('Linux') === 0)
151+
if(tmp[2] && tmp[2].indexOf('Linux') === 0)
152152
tmp[2] = 'linux';
153153

154-
if(tmp[2].indexOf('Darwin') === 0)
154+
if(tmp[2] && tmp[2].indexOf('Darwin') === 0)
155155
tmp[2] = 'darwin';
156156

157157
return $sce.trustAsHtml(tmp.join('/'));
@@ -466,16 +466,18 @@ angular.module('netStatsApp.filters', [])
466466
if(node.info.node) {
467467
var eth_version = node.info.node.split('/');
468468

469-
if(eth_version[1][0] !== 'v' && eth_version[1][2] !== '.')
470-
{
471-
eth_version.splice(1,1);
472-
}
469+
if(eth_version[1]){
470+
if(eth_version[1][0] !== 'v' && eth_version[1][2] !== '.')
471+
{
472+
eth_version.splice(1,1);
473+
}
473474

474-
string = "<b>" + node.info.node + "</b>";
475-
tooltip.push(string);
475+
string = "<b>" + node.info.node + "</b>";
476+
tooltip.push(string);
476477

477-
string = "Version: <b>" + (eth_version[1]) + "</b>";
478-
tooltip.push(string);
478+
string = "Version: <b>" + (eth_version[1]) + "</b>";
479+
tooltip.push(string);
480+
}
479481
}
480482

481483
if(node.info.net !== '') {

0 commit comments

Comments
 (0)