Skip to content

Commit

Permalink
Added check on MatAppearanceData before assigning it. (#786)
Browse files Browse the repository at this point in the history
* Added check on MatAppearanceData before assigning it.

* Added check on MatAppearanceData before assigning it.
  • Loading branch information
maxcapodi78 authored Jan 27, 2022
1 parent 85b4a58 commit 7c64c1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyaedt/modules/Material.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def __init__(self, materials, name, props=None):
self.name = name
self.coordinate_system = ""
if props:
self._props = props
self._props = props.copy()
else:
self._props = OrderedDict()
if "CoordinateSystemType" in self._props:
Expand Down Expand Up @@ -891,7 +891,7 @@ def __init__(self, materiallib, name, props=None):
else:
self.physics_type = ["Electromagnetic", "Thermal", "Structural"]
self._props["PhysicsTypes"] = OrderedDict({"set": ["Electromagnetic", "Thermal", "Structural"]})
if "AttachedData" in self._props:
if "AttachedData" in self._props and "MatAppearanceData" in self._props["AttachedData"]:
self._material_appearance = []
self._material_appearance.append(self._props["AttachedData"]["MatAppearanceData"]["Red"])
self._material_appearance.append(self._props["AttachedData"]["MatAppearanceData"]["Green"])
Expand Down

0 comments on commit 7c64c1c

Please sign in to comment.