Check servers length in Remote.getServer

This commit is contained in:
wltsmrz
2014-07-15 12:30:35 -07:00
parent 3535ce1b04
commit 37090716d3

View File

@@ -783,6 +783,10 @@ Remote.prototype.getServer = function() {
return this._primary_server;
}
if (!this._servers.length) {
return void(0);
}
function sortByScore(a, b) {
var aScore = a._score + a._fee;
var bScore = b._score + b._fee;