do not allow empty XML directory

This commit is contained in:
2021-09-13 11:26:38 +02:00
parent f18a53d61a
commit e75965fad2
4 changed files with 3 additions and 1 deletions

View File

@ -65,6 +65,8 @@ class XMLReflector:
filenames = [join(xmlfolder, filename) for filename in listdir(xmlfolder) if \
filename.endswith('.xml')]
filenames.sort()
if not filenames:
raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder])
for xmlfile in filenames:
try:
document = parse(xmlfile)