From d29bff1e71ec4bf8ebfc70d21f5363665a90f7b0 Mon Sep 17 00:00:00 2001 From: Scott McKendry Date: Sat, 16 May 2026 07:42:28 +1200 Subject: [PATCH] nil check on db close --- internal/bootstrap/app_bootstrap.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/bootstrap/app_bootstrap.go b/internal/bootstrap/app_bootstrap.go index a9fe010d..4851253b 100644 --- a/internal/bootstrap/app_bootstrap.go +++ b/internal/bootstrap/app_bootstrap.go @@ -19,6 +19,7 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/tinyauthapp/tinyauth/internal/model" "github.com/tinyauthapp/tinyauth/internal/repository" "github.com/tinyauthapp/tinyauth/internal/service" @@ -173,7 +174,9 @@ func (app *BootstrapApp) Setup() error { defer func() { app.cancel() app.wg.Wait() - app.db.Close() + if app.db != nil { + app.db.Close() + } }() // store