Adapt Db function to return nil in case the db is not initialized

This commit is contained in:
Theresa Gresch 2019-07-10 09:10:46 +02:00
parent 73d5871886
commit 31b29fa42b

View File

@ -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