1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 11:12:54 +08:00

Fix channel lookup not considering missing ids

This commit is contained in:
Dan Balasescu 2022-11-07 12:25:23 +09:00
parent cd8402df72
commit f931bdc5ff

View File

@ -420,7 +420,13 @@ namespace osu.Game.Online.Chat
{
Channel found = null;
bool lookupCondition(Channel ch) => lookup.Id > 0 ? ch.Id == lookup.Id : ch.Name == lookup.Name;
bool lookupCondition(Channel ch)
{
if (ch.Id > 0 && lookup.Id > 0)
return ch.Id == lookup.Id;
return ch.Name == lookup.Name;
}
var available = AvailableChannels.FirstOrDefault(lookupCondition);
if (available != null)