forked from mirror/mautrix-discord
Fix scanning reaction rows
This commit is contained in:
parent
800ca360c3
commit
7f8abc1f04
1 changed files with 3 additions and 1 deletions
|
@ -81,7 +81,8 @@ type Reaction struct {
|
|||
}
|
||||
|
||||
func (r *Reaction) Scan(row dbutil.Scannable) *Reaction {
|
||||
err := row.Scan(&r.Channel.ChannelID, &r.Channel.Receiver, &r.MessageID, &r.Sender, &r.EmojiName, &r.ThreadID, &r.MXID)
|
||||
var threadID sql.NullString
|
||||
err := row.Scan(&r.Channel.ChannelID, &r.Channel.Receiver, &r.MessageID, &r.Sender, &r.EmojiName, &threadID, &r.MXID)
|
||||
if err != nil {
|
||||
if !errors.Is(err, sql.ErrNoRows) {
|
||||
r.log.Errorln("Database scan failed:", err)
|
||||
|
@ -89,6 +90,7 @@ func (r *Reaction) Scan(row dbutil.Scannable) *Reaction {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
r.ThreadID = threadID.String
|
||||
|
||||
return r
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue