From 2f3948f466f70f73ef9e6e7b32b62eeb699d509c Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Wed, 3 Jun 2015 17:06:36 -0400 Subject: [PATCH] Fix a possible issue if no materials or no profiles exist --- Cura/gui/simpleMode.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index c52fa934..32cfe3b8 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -39,12 +39,13 @@ class simpleModePanel(wx.Panel): selectedMaterial = button break - if selectedMaterial is None and self._print_material_options > 0: + if selectedMaterial is None and len(self._print_material_options) > 0: selectedMaterial = self._print_material_options[0] # Decide to show the panel or not if len(self._print_material_options) < 2: - self.printMaterialPanel.Show(self._print_material_options[0].profile.always_visible) + self.printMaterialPanel.Show(len(self._print_material_options) > 1 and \ + self._print_material_options[0].profile.always_visible) self.printTypePanel = wx.Panel(self) @@ -112,12 +113,13 @@ class simpleModePanel(wx.Panel): selectedProfile = button break - if selectedProfile is None and self._print_profile_options > 0: + if selectedProfile is None and len(self._print_profile_options) > 0: selectedProfile = self._print_profile_options[0] # Decide if we show the profile panel or not if len(self._print_profile_options) < 2: - self.printProfilePanel.Show(self._print_profile_options[0].profile.always_visible) + self.printTypePanel.Show(len(self._print_profile_options) > 0 and \ + self._print_profile_options[0].profile.always_visible) if selectedProfile: selectedProfile.SetValue(True) -- 2.30.2