Fixed the check if vocations.xml were correctly loaded

This commit is contained in:
slawkens 2021-01-17 17:44:30 +01:00
parent b2b0b31168
commit b24370e7ed

View File

@ -142,10 +142,8 @@ else {
if(!@file_exists($file))
$file = $config['data_path'] . 'vocations.xml';
$vocations->load($file);
if(!$vocations)
throw new RuntimeException('ERROR: Cannot load <i>vocations.xml</i> file.');
if(!$vocations->load($file))
throw new RuntimeException('ERROR: Cannot load <i>vocations.xml</i> - the file is malformed. Check the file with xml syntax validator.');
$config['vocations'] = array();
foreach($vocations->getElementsByTagName('vocation') as $vocation) {