Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Fix scanning non-logged-in users from db
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Oct 6, 2023
1 parent ab22788 commit f6652b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions database/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ func (u *User) Update() error {
}

func (u *User) Scan(row dbutil.Scannable) *User {
var username, managementRoom sql.NullString
var username, managementRoom, signalID sql.NullString
err := row.Scan(
&u.MXID,
&username,
&u.SignalID,
&signalID,
&managementRoom,
)
if err != nil {
Expand All @@ -72,6 +72,7 @@ func (u *User) Scan(row dbutil.Scannable) *User {
return nil
}
u.SignalUsername = username.String
u.SignalID = signalID.String
u.ManagementRoom = id.RoomID(managementRoom.String)
return u
}
Expand Down

0 comments on commit f6652b3

Please sign in to comment.