Don't panic on PostScan errors. Fix #3118

This commit is contained in:
Deluan
2024-06-25 17:14:17 -04:00
parent 3bc9e75b28
commit 7111535963
3 changed files with 30 additions and 8 deletions
+4 -1
View File
@@ -275,7 +275,10 @@ func (r sqlRepository) count(countQuery SelectBuilder, options ...model.QueryOpt
}
func (r sqlRepository) put(id string, m interface{}, colsToUpdate ...string) (newId string, err error) {
values, _ := toSQLArgs(m)
values, err := toSQLArgs(m)
if err != nil {
return "", fmt.Errorf("error preparing values to write to DB: %w", err)
}
// If there's an ID, try to update first
if id != "" {
updateValues := map[string]interface{}{}