Check servers length in Remote.getServer

This commit is contained in:
wltsmrz
2014-07-15 12:30:35 -07:00
committed by Geert Weening
parent 1d4bcd4e0f
commit c1a0be2402

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;