1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Add safety for channel with no messages

This commit is contained in:
Dean Herbert 2020-01-13 12:22:44 +09:00
parent 902e1750a8
commit c190c68659

View File

@ -454,7 +454,11 @@ namespace osu.Game.Online.Chat
if (channel.LastMessageId == channel.LastReadId)
return;
var message = channel.Messages.Last();
var message = channel.Messages.LastOrDefault();
if (message == null)
return;
var req = new MarkChannelAsReadRequest(channel, message);
req.Success += () => channel.LastReadId = message.Id;