[libcalamares] Asking for type of undefined node throws
- Use YAML-CPP API for finding out if a node has a value at all. - Asking for Type() of an undefined or NULL node throws an exception, so the existing code didn't **actually** catch cases where a required setting wasn't set at all.
This commit is contained in:
parent
ec09272b81
commit
d59a44be44
@ -32,7 +32,7 @@
|
||||
static bool
|
||||
hasValue( const YAML::Node& v )
|
||||
{
|
||||
return !( ( v.Type() == YAML::NodeType::Null ) || ( v.Type() == YAML::NodeType::Undefined ) );
|
||||
return v.IsDefined() && !v.IsNull();
|
||||
}
|
||||
|
||||
/** Helper function to grab a QString out of the config, and to warn if not present. */
|
||||
|
Loading…
Reference in New Issue
Block a user