1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 16:57:21 +08:00

Fix crash on creating two new PM channels

This commit is contained in:
Dean Herbert 2018-11-22 18:27:22 +09:00
parent d1ec9fc294
commit a144e97568

View File

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