Update snaplist.py

fix: done() is called before the snap has loaded causing Attribute error
This commit is contained in:
lambda-propaganda 2021-09-06 14:27:54 +01:00 committed by Dan Bungert
parent 1a3bcbc1c4
commit 6e99143396
1 changed files with 4 additions and 0 deletions

View File

@ -462,6 +462,10 @@ class SnapListView(BaseView):
"package, publisher and versions available."))
def done(self, sender=None):
if not hasattr(self, 'selections_by_name'):
log.warning('failed to obtain a snaps selection')
return self.offer_retry()
log.debug("snaps to install %s", self.selections_by_name)
self.controller.done(sorted(
self.selections_by_name.values(),