Add missing nil check
This commit is contained in:
parent
874afb19bd
commit
205e6a9751
1 changed files with 1 additions and 1 deletions
2
user.go
2
user.go
|
@ -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)
|
lastMessage, err := user.bridge.DB.Message.GetByID(ctx, portal.Receiver, lastMessageID)
|
||||||
if err == nil && (lastMessage == nil || lastMessage.IsFakeMXID()) {
|
if err == nil && (lastMessage == nil || lastMessage.IsFakeMXID()) {
|
||||||
lastMessage, err = user.bridge.DB.Message.GetLastInChatWithMXID(ctx, portal.Key)
|
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
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue