From b7ccb5a294ffcea720a2ef956c65b17058594fd4 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 5 Feb 2018 14:35:01 +0200 Subject: [PATCH] Fix queries going to lobby if the network name matches user name Fixes #1501 Fixes #1983 --- src/models/network.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/models/network.js b/src/models/network.js index 82eb8eba..ea120bc1 100644 --- a/src/models/network.js +++ b/src/models/network.js @@ -133,7 +133,8 @@ Network.prototype.export = function() { Network.prototype.getChannel = function(name) { name = name.toLowerCase(); - return _.find(this.channels, function(that) { - return that.name.toLowerCase() === name; + return _.find(this.channels, function(that, i) { + // Skip network lobby (it's always unshifted into first position) + return i > 0 && that.name.toLowerCase() === name; }); };