appmenus: don't crash on VM without files on disk
Such VM can still trigger some appmenus-related action, for example label change. This may happen during tests, or backup restore. And probably some other cases.
This commit is contained in:
parent
fe209dfd24
commit
86ef6906ad
@ -142,7 +142,10 @@ class AppmenusExtension(qubes.ext.Extension):
|
||||
anything_changed = True
|
||||
|
||||
templates_dir = self.templates_dir(vm)
|
||||
if os.path.exists(templates_dir):
|
||||
appmenus = os.listdir(templates_dir)
|
||||
else:
|
||||
appmenus = []
|
||||
changed_appmenus = []
|
||||
if os.path.exists(self.whitelist_path(vm)):
|
||||
whitelist = [x.rstrip() for x in open(self.whitelist_path(vm))]
|
||||
|
Loading…
Reference in New Issue
Block a user