diff options
author | Max Kellermann <max@duempel.org> | 2013-09-26 17:33:46 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-26 17:33:46 +0200 |
commit | 7ca0aedcfc35c784d7ae07cd1f1e8dce684e5901 (patch) | |
tree | 6b4e24ac7670b0e6ccd3347afeae5953d4c477fd | |
parent | a2c4037a24bca167ced4c12bdeb897c92f508913 (diff) | |
download | mpd-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().
-rw-r--r-- | src/Main.cxx | 3 |
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); |