Skip to content

Commit

Permalink
fix XRayDiffractionComponent AttributeError NoneType has no attribute…
Browse files Browse the repository at this point in the history
… sites in self.from_data(structure).sites
  • Loading branch information
janosh committed Jun 28, 2024
1 parent 9d0f896 commit a4140a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crystal_toolkit/components/diffraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ def pattern_from_struct(struct, rad_source):
Output(self.id("large_cell_note"), "children"),
Input(self.id("structure"), "data"),
)
def update_message(structure):
if len(self.from_data(structure).sites) < SITES_LIMIT:
def update_message(structure: Structure | None):
if structure is None or len(self.from_data(structure).sites) < SITES_LIMIT:
return html.Div([])
return MessageContainer(
MessageBody(
Expand Down

0 comments on commit a4140a6

Please sign in to comment.