some additional Scan error handling

This commit is contained in:
2025-12-29 22:20:51 -07:00
parent 98a74487c2
commit 07395b9c1d
2 changed files with 21 additions and 11 deletions
+6 -2
View File
@@ -18,6 +18,7 @@ import (
lru "github.com/hashicorp/golang-lru"
"github.com/jmoiron/sqlx"
log "github.com/sirupsen/logrus"
)
// Conference struct is the top-level structure for a conference.
@@ -75,8 +76,11 @@ func (c *Conference) Aliases(ctx context.Context) ([]string, error) {
rc := make([]string, 0, 5)
for rs.Next() {
var a string
rs.Scan(&a)
rc = append(rc, a)
if err = rs.Scan(&a); err == nil {
rc = append(rc, a)
} else {
log.Errorf("Aliases scan error: %v", err)
}
}
return rc, nil
}