summaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go5
1 files changed, 4 insertions, 1 deletions
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.