ConfigData: handle default_value==nullptr
Return Path::Null() instead of dying from assertion failure.
This commit is contained in:
parent
0e0be0243b
commit
0339c8d025
@ -108,8 +108,12 @@ config_param::GetBlockPath(const char *name, const char *default_value,
|
|||||||
if (bp != nullptr) {
|
if (bp != nullptr) {
|
||||||
line2 = bp->line;
|
line2 = bp->line;
|
||||||
s = bp->value.c_str();
|
s = bp->value.c_str();
|
||||||
} else
|
} else {
|
||||||
|
if (default_value == nullptr)
|
||||||
|
return Path::Null();
|
||||||
|
|
||||||
s = default_value;
|
s = default_value;
|
||||||
|
}
|
||||||
|
|
||||||
Path path = ParsePath(s, error);
|
Path path = ParsePath(s, error);
|
||||||
if (gcc_unlikely(path.IsNull()))
|
if (gcc_unlikely(path.IsNull()))
|
||||||
|
Loading…
Reference in New Issue
Block a user