Fix Puppet.Scan()

This commit is contained in:
Tulir Asokan 2018-09-02 00:44:10 +03:00
parent c4ada14c2f
commit a893377cc5

View file

@ -77,7 +77,8 @@ type Puppet struct {
func (puppet *Puppet) Scan(row Scannable) *Puppet {
var displayname, avatar sql.NullString
err := row.Scan(&puppet.JID, &displayname, &avatar)
var quality sql.NullInt64
err := row.Scan(&puppet.JID, &avatar, &displayname, &quality)
if err != nil {
if err != sql.ErrNoRows {
puppet.log.Errorln("Database scan failed:", err)
@ -86,6 +87,7 @@ func (puppet *Puppet) Scan(row Scannable) *Puppet {
}
puppet.Displayname = displayname.String
puppet.Avatar = avatar.String
puppet.NameQuality = int8(quality.Int64)
return puppet
}