diff --git a/internal/entity/db.go b/internal/entity/db.go index 0589623f5..52d543574 100644 --- a/internal/entity/db.go +++ b/internal/entity/db.go @@ -15,6 +15,10 @@ func init() { // Db returns the default *gorm.DB connection. func Db() *gorm.DB { + if dbConn == nil { + return nil + } + return dbConn.Db() }