Configs: empty config files are ok.
The default umount.conf contains no keys -- so it isn't a map, but it is a valid config file. Avoid the warning by accepting empty files. FIX 707
This commit is contained in:
parent
0659fc72b8
commit
1415ec69be
@ -176,6 +176,12 @@ Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::Ex
|
||||
QByteArray ba = configFile.readAll();
|
||||
|
||||
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() )
|
||||
{
|
||||
cLog() << Q_FUNC_INFO << "bad module configuration format"
|
||||
|
Loading…
Reference in New Issue
Block a user