Add missing nil check

This commit is contained in:
Tulir Asokan 2024-03-27 20:01:38 +02:00
parent 874afb19bd
commit 205e6a9751

View file

@ -1175,7 +1175,7 @@ func (user *User) markSelfReadFull(ctx context.Context, portal *Portal, lastMess
lastMessage, err := user.bridge.DB.Message.GetByID(ctx, portal.Receiver, lastMessageID)
if err == nil && (lastMessage == nil || lastMessage.IsFakeMXID()) {
lastMessage, err = user.bridge.DB.Message.GetLastInChatWithMXID(ctx, portal.Key)
if idToInt(lastMessage.ID) > idToInt(lastMessageID) {
if lastMessage != nil && idToInt(lastMessage.ID) > idToInt(lastMessageID) {
return
}
}