Fix error on refresh when a VM has vanished

Fixes error that can occur when VM-removed and VM-changed
events fire too closely together.

fixes QubesOS/qubes-issues#4317
This commit is contained in:
Marta Marczykowska-Górecka 2018-09-21 12:43:59 +02:00
parent 8d73952404
commit f618716548
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -462,7 +462,10 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
self.table.removeRow(row_to_delete.name_widget.row())
def on_domain_status_changed(self, vm, _event, **_kwargs):
self.vms_in_table[vm.qid].info_widget.update_vm_state()
try:
self.vms_in_table[vm.qid].info_widget.update_vm_state()
except exc.QubesPropertyAccessError:
return # the VM was deleted before its status could be updated
if vm == self.get_selected_vm():
self.table_selection_changed()
@ -473,7 +476,10 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
row.info_widget.update_vm_state()
def on_domain_changed(self, vm, _event, **_kwargs):
self.vms_in_table[vm.qid].update()
try:
self.vms_in_table[vm.qid].update()
except exc.QubesPropertyAccessError:
return # the VM was deleted before its status could be updated
def load_manager_settings(self):
# visible columns