aboutsummaryrefslogtreecommitdiffstats
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-26 17:33:46 +0200
committerMax Kellermann <max@duempel.org>2013-09-26 17:33:46 +0200
commit7ca0aedcfc35c784d7ae07cd1f1e8dce684e5901 (patch)
tree6b4e24ac7670b0e6ccd3347afeae5953d4c477fd /src/Main.cxx
parenta2c4037a24bca167ced4c12bdeb897c92f508913 (diff)
downloadmpd-7ca0aedcfc35c784d7ae07cd1f1e8dce684e5901.tar.gz
mpd-7ca0aedcfc35c784d7ae07cd1f1e8dce684e5901.tar.xz
mpd-7ca0aedcfc35c784d7ae07cd1f1e8dce684e5901.zip
Main: fix crash if no database was configured
Add nullptr check, and return early from glue_db_init_and_load().
Diffstat (limited to 'src/Main.cxx')
-rw-r--r--src/Main.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 210fe2366..8bb997090 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -181,6 +181,9 @@ glue_db_init_and_load(void)
param = allocated;
}
+ if (param == nullptr)
+ return true;
+
Error error;
if (!DatabaseGlobalInit(*param, error))
FatalError(error);