From d59a44be44831a799c0fc4ee388c9fd4fee51bac Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 20 Jun 2018 15:59:23 +0200 Subject: [PATCH] [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. --- src/libcalamares/Settings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcalamares/Settings.cpp b/src/libcalamares/Settings.cpp index ac4cea896..1fdfc6daa 100644 --- a/src/libcalamares/Settings.cpp +++ b/src/libcalamares/Settings.cpp @@ -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. */