diff options
author | Max Kellermann <max@duempel.org> | 2013-10-02 08:56:02 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-02 08:56:02 +0200 |
commit | 0339c8d025a9428101da9ab3637636dcc4d271c5 (patch) | |
tree | 3ab7f8e7ab3d4dfce0251e1d30d85c4abf7c30ef /src/ConfigData.cxx | |
parent | 0e0be0243bdf2fe8cbd88bd530ec7b7040b4d9da (diff) | |
download | mpd-0339c8d025a9428101da9ab3637636dcc4d271c5.tar.gz mpd-0339c8d025a9428101da9ab3637636dcc4d271c5.tar.xz mpd-0339c8d025a9428101da9ab3637636dcc4d271c5.zip |
ConfigData: handle default_value==nullptr
Return Path::Null() instead of dying from assertion failure.
Diffstat (limited to 'src/ConfigData.cxx')
-rw-r--r-- | src/ConfigData.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ConfigData.cxx b/src/ConfigData.cxx index f255e3488..611c5b91a 100644 --- a/src/ConfigData.cxx +++ b/src/ConfigData.cxx @@ -108,8 +108,12 @@ config_param::GetBlockPath(const char *name, const char *default_value, if (bp != nullptr) { line2 = bp->line; s = bp->value.c_str(); - } else + } else { + if (default_value == nullptr) + return Path::Null(); + s = default_value; + } Path path = ParsePath(s, error); if (gcc_unlikely(path.IsNull())) |