Skip to content

Commit

Permalink
Add missing nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Mar 27, 2024
1 parent 874afb1 commit 205e6a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 205e6a9

Please sign in to comment.