From 91fc1f1c92d06d875b2e6293ac8d352716bdfb20 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 1 Oct 2020 10:55:00 +0100 Subject: [PATCH] Fix bug in error handling in SQLite InsertPreviousEvent (#1456) --- roomserver/storage/sqlite3/previous_events_table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roomserver/storage/sqlite3/previous_events_table.go b/roomserver/storage/sqlite3/previous_events_table.go index 222b53b93..aaee62733 100644 --- a/roomserver/storage/sqlite3/previous_events_table.go +++ b/roomserver/storage/sqlite3/previous_events_table.go @@ -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