From 4deaedd1e0383519c9847aec7b3af9cfbee5bd7d Mon Sep 17 00:00:00 2001 From: donoban Date: Sun, 25 Nov 2018 19:15:56 +0100 Subject: [PATCH] Fix errors when some domain fails to start --- qubesmanager/qube_manager.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index 48a3532..d031840 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -514,12 +514,17 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow): pass def on_domain_added(self, _submitter, _event, vm, **_kwargs): - domain = self.qubes_app.domains[vm] + row_no = 0 self.table.setSortingEnabled(False) - row_no = self.table.rowCount() - self.table.setRowCount(row_no + 1) - vm_row = VmRowInTable(domain, row_no, self.table) - self.vms_in_table[domain.qid] = vm_row + try: + domain = self.qubes_app.domains[vm] + row_no = self.table.rowCount() + self.table.setRowCount(row_no + 1) + vm_row = VmRowInTable(domain, row_no, self.table) + self.vms_in_table[domain.qid] = vm_row + except (exc.QubesException, KeyError): + if row_no != 0: + self.table.removeRow(row_no) self.table.setSortingEnabled(True) self.showhide_vms()