Skip to content

Commit

Permalink
Fix undefined relay addresses
Browse files Browse the repository at this point in the history
+ npm update
  • Loading branch information
Jyben committed Jun 18, 2020
1 parent 245f899 commit a0d238c
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 110 deletions.
6 changes: 6 additions & 0 deletions app/main-process/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ PingWrapper.prototype.execute = function () {
try {
this._clusters.clustersId.forEach(id => {

if (this._clusters.pops[id].relayAddresses === undefined) this._clusters.pops[id].relayAddresses = [];

this._clusters.pops[id].relayAddresses.forEach(relayAddresse => {
if (relayAddresse === undefined) {
this._clusters.pops[id].relayAddresses.splice(this._clusters.pops[id].relayAddresses.indexOf(relayAddresse), 1);
return;
}
this._clusters.pops[id].relayAddresses.splice(this._clusters.pops[id].relayAddresses.indexOf(relayAddresse), 1, relayAddresse.split(':')[0]);
});

Expand Down
Loading

0 comments on commit a0d238c

Please sign in to comment.