Adapt Db function to return nil in case the db is not initialized
This commit is contained in:
parent
73d5871886
commit
31b29fa42b
1 changed files with 2 additions and 1 deletions
|
@ -434,7 +434,8 @@ func (c *Config) HttpStaticBuildPath() string {
|
|||
// Db returns the db connection.
|
||||
func (c *Config) Db() *gorm.DB {
|
||||
if c.db == nil {
|
||||
log.Fatal("database not initialised.")
|
||||
log.Error("database not initialised.")
|
||||
return nil
|
||||
}
|
||||
|
||||
return c.db
|
||||
|
|
Loading…
Reference in a new issue