Merge branch 'allow-empty-configs'

This commit is contained in:
Adriaan de Groot 2017-06-02 16:19:50 +02:00
commit bc4cbd7964
2 changed files with 7 additions and 1 deletions

View File

@ -176,6 +176,12 @@ Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::Ex
QByteArray ba = configFile.readAll(); QByteArray ba = configFile.readAll();
YAML::Node doc = YAML::Load( ba.constData() ); YAML::Node doc = YAML::Load( ba.constData() );
if ( doc.IsNull() )
{
// Special case: empty config files are valid,
// but aren't a map.
return;
}
if ( !doc.IsMap() ) if ( !doc.IsMap() )
{ {
cLog() << Q_FUNC_INFO << "bad module configuration format" cLog() << Q_FUNC_INFO << "bad module configuration format"

View File

@ -1,5 +1,5 @@
--- ---
#scrLog: "/path/to/installation.log" #srcLog: "/path/to/installation.log"
#destLog: "/var/log/installation.log" #destLog: "/var/log/installation.log"
# example when using the Calamares created log: # example when using the Calamares created log:
#srcLog: "/root/.cache/Calamares/Calamares/Calamares.log" #srcLog: "/root/.cache/Calamares/Calamares/Calamares.log"