From 1bd3b80293bf27fe7a9a845d4e845e102d068810 Mon Sep 17 00:00:00 2001 From: quentinchampenois <26109239+Quentinchampenois@users.noreply.github.com> Date: Sat, 14 Sep 2024 11:06:32 +0200 Subject: [PATCH] fix: Handle errors during version scan --- app/pkg/dbx/migrate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/pkg/dbx/migrate.go b/app/pkg/dbx/migrate.go index e749a7472..a7941402d 100644 --- a/app/pkg/dbx/migrate.go +++ b/app/pkg/dbx/migrate.go @@ -157,7 +157,9 @@ func getPendingMigrations(versions []int) ([]int, error) { for rows.Next() { var version int - _ = rows.Scan(&version) + if err := rows.Scan(&version); err != nil { + return nil, errors.Wrap(err, "failed to scan version") + } i := slices.Index(pendingMigrations, version) if i != -1 { pendingMigrations = slices.Delete(pendingMigrations, i, i+1)