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:
parent
902e1750a8
commit
c190c68659
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user