mate-desktop / mozo

Menu editor for MATE using the freedesktop.org menu specification
http://www.mate-desktop.org
GNU Lesser General Public License v2.1
28 stars 12 forks source link

Mozo refuses to start if mate-applications.menu is empty. #31

Open lah7 opened 7 years ago

lah7 commented 7 years ago

The application silently crashes when ~/.config/menus/mate-applications.menu is blank, possibly by something that corrupted the file or crashed mid-way.

** (mozo:20289): WARNING **: Error loading menu layout from "/home/virtualbox/.config/menus/mate-applications.menu": Error on line 1 char 1: Document must begin with an element (e.g. )
Traceback (most recent call last):
File "/usr/bin/mozo", line 36, in 
main()
File "/usr/bin/mozo", line 32, in main
app = MainWindow(datadir, version, sys.argv)
File "/usr/lib/python2.7/dist-packages/Mozo/MainWindow.py", line 56, in init
self.editor = MenuEditor()
File "/usr/lib/python2.7/dist-packages/Mozo/MenuEditor.py", line 38, in init
self.__loadMenus()
File "/usr/lib/python2.7/dist-packages/Mozo/MenuEditor.py", line 53, in __loadMenus
self.applications.dom = xml.dom.minidom.parseString(util.getUserMenuXml(self.applications.tree))
File "/usr/lib/python2.7/dist-packages/Mozo/util.py", line 127, in getUserMenuXml
name = tree.root.get_menu_id()
AttributeError: 'NoneType' object has no attribute 'get_menu_id'