From 0339c8d025a9428101da9ab3637636dcc4d271c5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 2 Oct 2013 08:56:02 +0200 Subject: ConfigData: handle default_value==nullptr Return Path::Null() instead of dying from assertion failure. --- src/ConfigData.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ConfigData.cxx') 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())) -- cgit v1.2.3