Add missing nil check

This commit is contained in:
Tulir Asokan 2023-12-13 19:57:23 +02:00
parent e780eb2eb6
commit 3e29c51c06

View file

@ -4622,7 +4622,7 @@ func (portal *Portal) HandleMatrixMessage(sender *User, evt *event.Event, timing
return
}
dbMsg.MarkSent(resp.Timestamp)
if len(extraMeta.GalleryExtraParts) > 0 {
if extraMeta != nil && len(extraMeta.GalleryExtraParts) > 0 {
for i, part := range extraMeta.GalleryExtraParts {
partInfo := portal.generateMessageInfo(sender)
partDBMsg := portal.markHandled(nil, nil, partInfo, evt.ID, evt.Sender, false, true, database.MsgBeeperGallery, i+1, database.MsgNoError)