From e8df7e8da5a075178224b130c0602b62c85508a9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 22 Aug 2012 21:40:20 +0200 Subject: Database*: fix nullptr dereference when no database is configured --- src/DatabaseGlue.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/DatabaseGlue.hxx') diff --git a/src/DatabaseGlue.hxx b/src/DatabaseGlue.hxx index 79eea135..b38ba595 100644 --- a/src/DatabaseGlue.hxx +++ b/src/DatabaseGlue.hxx @@ -21,6 +21,7 @@ #define MPD_DATABASE_GLUE_HXX #include "gcc.h" +#include "gerror.h" class Database; @@ -32,4 +33,12 @@ gcc_pure const Database * GetDatabase(); +/** + * Returns the global #Database instance. May return NULL if this MPD + * configuration has no database (no music_directory was configured). + */ +gcc_pure +const Database * +GetDatabase(GError **error_r); + #endif -- cgit v1.2.3