Skip to content

Commit a4140a6

Browse files
committed
fix XRayDiffractionComponent AttributeError NoneType has no attribute sites in self.from_data(structure).sites
1 parent 9d0f896 commit a4140a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crystal_toolkit/components/diffraction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ def pattern_from_struct(struct, rad_source):
503503
Output(self.id("large_cell_note"), "children"),
504504
Input(self.id("structure"), "data"),
505505
)
506-
def update_message(structure):
507-
if len(self.from_data(structure).sites) < SITES_LIMIT:
506+
def update_message(structure: Structure | None):
507+
if structure is None or len(self.from_data(structure).sites) < SITES_LIMIT:
508508
return html.Div([])
509509
return MessageContainer(
510510
MessageBody(

0 commit comments

Comments
 (0)