Commit b0b8e8b02db581c6cf330e551af38abb61fc30ab

Authored by Thiago Franco de Moraes
1 parent ffb93c3a

not setting the surface combobox when there is not a item

Showing 1 changed file with 5 additions and 4 deletions   Show diff stats
invesalius/gui/task_surface.py
@@ -485,10 +485,11 @@ class SurfaceProperties(wx.Panel): @@ -485,10 +485,11 @@ class SurfaceProperties(wx.Panel):
485 s = self.combo_surface_name.GetSelection() 485 s = self.combo_surface_name.GetSelection()
486 self.combo_surface_name.SetItems([n[0] for n in self.surface_list]) 486 self.combo_surface_name.SetItems([n[0] for n in self.surface_list])
487 487
488 - if s in list_index:  
489 - self.combo_surface_name.SetSelection(0)  
490 - else:  
491 - self.combo_surface_name.SetSelection(s) 488 + if self.surface_list:
  489 + if s in list_index:
  490 + self.combo_surface_name.SetSelection(0)
  491 + else:
  492 + self.combo_surface_name.SetSelection(s)
492 493
493 def OnCloseProject(self, pubsub_evt): 494 def OnCloseProject(self, pubsub_evt):
494 self.CloseProject() 495 self.CloseProject()