Skip to content

Commit ac1ff0a

Browse files
committed
nil check on db close
1 parent ea15206 commit ac1ff0a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

internal/bootstrap/app_bootstrap.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"time"
2020

2121
"github.com/gin-gonic/gin"
22+
2223
"github.com/tinyauthapp/tinyauth/internal/model"
2324
"github.com/tinyauthapp/tinyauth/internal/repository"
2425
"github.com/tinyauthapp/tinyauth/internal/service"
@@ -173,7 +174,9 @@ func (app *BootstrapApp) Setup() error {
173174
defer func() {
174175
app.cancel()
175176
app.wg.Wait()
176-
app.db.Close()
177+
if app.db != nil {
178+
app.db.Close()
179+
}
177180
}()
178181

179182
// store

0 commit comments

Comments
 (0)