Skip to content

Commit

Permalink
only be recursive on dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
andped10 committed Nov 9, 2024
1 parent 574e770 commit 5686d15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/easyreflectometry/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def collect_unique_names_from_dict(structure_dict: dict, unique_names: Optional[
collect_unique_names_from_dict(value, unique_names)
elif isinstance(value, list):
for element in value:
collect_unique_names_from_dict(element, unique_names)
if isinstance(value, dict):
collect_unique_names_from_dict(element, unique_names)
if key == 'unique_name':
unique_names.append(value)
return unique_names

0 comments on commit 5686d15

Please sign in to comment.