openSUSE / docmanager

Manage DocBook 5 Meta Information
http://opensuse.github.io/docmanager/index.html
GNU General Public License v3.0
6 stars 6 forks source link

Fix "index out of range" exception #25

Closed mschnitzer closed 9 years ago

mschnitzer commented 9 years ago

If the title element in an XML file is not available, DocManager throws an exception:

14:39:30 [WARNING]: Can't find the <info> element in 'example3.xml'. Adding one.
Traceback (most recent call last):
  File "/usr/bin/docmanager", line 9, in <module>
    load_entry_point('docmanager==3.0.0', 'console_scripts', 'docmanager')()
  File "/usr/lib/python3.4/site-packages/docmanager/__init__.py", line 180, in main
    action.Actions( parsecli(cliargs) )
  File "/usr/lib/python3.4/site-packages/docmanager/action.py", line 45, in __init__
    self.__files = filehandler.Files(files)
  File "/usr/lib/python3.4/site-packages/docmanager/filehandler.py", line 51, in __init__
    self.__xml_handlers.append(xmlhandler.XmlHandler(f))
  File "/usr/lib/python3.4/site-packages/docmanager/xmlhandler.py", line 89, in __init__
    self.create_group()
  File "/usr/lib/python3.4/site-packages/docmanager/xmlhandler.py", line 107, in create_group
    title = self.__root.getchildren()[0]
IndexError: list index out of range