diff --git a/src/blenderbim/blenderbim/bim/module/profile/ui.py b/src/blenderbim/blenderbim/bim/module/profile/ui.py index d57d626602..9011c9152d 100644 --- a/src/blenderbim/blenderbim/bim/module/profile/ui.py +++ b/src/blenderbim/blenderbim/bim/module/profile/ui.py @@ -16,15 +16,14 @@ # You should have received a copy of the GNU General Public License # along with BlenderBIM Add-on. If not, see . -from bpy.types import Panel, UIList import bpy - import blenderbim.bim.helper import blenderbim.tool as tool +from bpy.types import Panel, UIList from blenderbim.bim.module.profile.data import ProfileData from blenderbim.bim.module.profile.prop import generate_thumbnail_for_active_profile -# Profile Manager Class + class BIM_PT_profiles(Panel): bl_label = "IFC Profiles" bl_idname = "BIM_PT_profiles" @@ -43,11 +42,10 @@ class BIM_PT_profiles(Panel): ProfileData.load() self.props = context.scene.BIMProfileProperties - if self.props.is_editing: + if self.props.is_editing and self.props.profiles and self.props.active_profile_index < len(self.props.profiles): preview_collection = ProfileData.preview_collection box = self.layout.box() profile_id = self.props.profiles[self.props.active_profile_index].ifc_definition_id - profile_id_str = str(profile_id) if profile_id_str in preview_collection: preview_image = preview_collection[profile_id_str]