Main: check if database exists before attempting to close it
Fixes nullptr dereference.
This commit is contained in:
parent
6da0af94df
commit
ff62b6742b
@ -595,8 +595,11 @@ int mpd_main(int argc, char *argv[])
|
||||
|
||||
#ifdef ENABLE_DATABASE
|
||||
delete instance->update;
|
||||
instance->database->Close();
|
||||
delete instance->database;
|
||||
|
||||
if (instance->database != nullptr) {
|
||||
instance->database->Close();
|
||||
delete instance->database;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SQLITE
|
||||
|
Loading…
Reference in New Issue
Block a user