diff --git a/models/models.go b/models/models.go index b2f5e923e7..549d2eadc9 100644 --- a/models/models.go +++ b/models/models.go @@ -335,7 +335,10 @@ func GetStatistic() (stats Statistic) { // Ping tests if database is alive func Ping() error { - return x.Ping() + if x != nil { + return x.Ping() + } + return errors.New("database not configured") } // DumpDatabase dumps all data from database according the special database SQL syntax to file system.