Fix bug in error handling in SQLite InsertPreviousEvent

This commit is contained in:
Neil Alexander 2020-10-01 09:58:36 +01:00
parent fed3ebd2f1
commit fcb1205d52
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -98,7 +98,7 @@ func (s *previousEventStatements) InsertPreviousEvent(
eventNIDAsString := fmt.Sprintf("%d", eventNID)
selectStmt := sqlutil.TxStmt(txn, s.selectPreviousEventExistsStmt)
err := selectStmt.QueryRowContext(ctx, previousEventID, previousEventReferenceSHA256).Scan(&eventNIDs)
if err != sql.ErrNoRows {
if err != nil && err != sql.ErrNoRows {
return fmt.Errorf("selectStmt.QueryRowContext.Scan: %w", err)
}
var nids []string