Skip to content
Snippets Groups Projects
Commit 6b8ba23c authored by deuce's avatar deuce
Browse files

Don't call auth_cb() if it's undefined, parse remote addresses in try/catch.

parent 05db9a49
No related branches found
No related tags found
No related merge requests found
...@@ -209,7 +209,6 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port) ...@@ -209,7 +209,6 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port)
if (password === undefined) if (password === undefined)
password = '-'; password = '-';
if (port === undefined) if (port === undefined)
port = 24554; port = 24554;
...@@ -254,7 +253,8 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port) ...@@ -254,7 +253,8 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port)
return false; return false;
} }
auth_cb(this.authenticated, this); if (auth_cb !== undefined)
auth_cb(this.authenticated, this);
if (js.terminated) { if (js.terminated) {
this.close(); this.close();
...@@ -702,7 +702,11 @@ BinkP.prototype.recvFrame = function(timeout) ...@@ -702,7 +702,11 @@ BinkP.prototype.recvFrame = function(timeout)
else { else {
this.remote_addrs = []; this.remote_addrs = [];
ret.data.split(/ /).forEach(function(addr) { ret.data.split(/ /).forEach(function(addr) {
this.remote_addrs.push(FIDO.parse_addr(addr, this.default_zone)); try {
this.remote_addrs.push(FIDO.parse_addr(addr, this.default_zone));
}
catch (e) {
}
}, this); }, this);
} }
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment