Skip to content

Commit

Permalink
fix(wifi): resolve infinite loop of tries
Browse files Browse the repository at this point in the history
  • Loading branch information
HipsterBrown committed Apr 17, 2017
1 parent ec31f28 commit 91e745b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/tessel/wifi.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ Tessel.prototype.connectToNetwork = function(opts) {

if (password && security) {
status += `, password: ${password}, security: ${security}`;
} else if (!password && (!security || security === 'none')) {
}

if (!password && !security) {
security = 'none';
}

Expand Down Expand Up @@ -213,7 +215,8 @@ Tessel.prototype.setWiFiState = function(enable) {
}
this.receive(remoteProcess, (err, result) => {
if (err) {
if (err.toString().includes('Not found')) {
if (err.toString().includes('Not found') && tries) {
tries--;
return pollForWifiSignal();
} else {
return reject(err);
Expand Down

0 comments on commit 91e745b

Please sign in to comment.