Skip to content

Commit

Permalink
prototyp.Hash: fix nil SQL Scan
Browse files Browse the repository at this point in the history
  • Loading branch information
klaidliadon authored Nov 29, 2023
1 parent ee13316 commit 7d17374
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/prototyp/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ func (h *Hash) Scan(src interface{}) error {
// NOTE: the 'scany' package we use is unable to scan values of
// *string, aka *prototyp.Hash, when needing to have a nullable Hash
// please use the HashMaybe type instead.
if src == nil {
return nil
}
*h = HashFromBytes(src.([]byte))
return nil
}

0 comments on commit 7d17374

Please sign in to comment.