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