From 7ca0aedcfc35c784d7ae07cd1f1e8dce684e5901 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 26 Sep 2013 17:33:46 +0200 Subject: [PATCH] Main: fix crash if no database was configured Add nullptr check, and return early from glue_db_init_and_load(). --- src/Main.cxx | 3 +++ 1 file changed, 3 insertions(+) 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);