details: Fix error with usbredir if no viewer was created

This commit is contained in:
Cole Robinson 2013-07-07 12:15:53 -04:00
parent 149e19da64
commit 39a819c34b

View File

@ -1562,8 +1562,9 @@ class vmmDetails(vmmGObjectUI):
self.vm.get_uuid())
def control_vm_menu(self, src_ignore):
if self.console.viewer.has_usb_redirection() and \
self.vm.has_spicevmc_type_redirdev():
if (self.console.viewer and
self.console.viewer.has_usb_redirection() and
self.vm.has_spicevmc_type_redirdev()):
widget = self.widget("details-menu-usb-redirection")
if not widget.get_sensitive():
widget.set_sensitive(True)