Skip to content

Commit

Permalink
Guard against missing nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Dec 30, 2024
1 parent cc50b39 commit a5f3156
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/aiidalab_qe/common/bands_pdos/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def extract_pdos_output(node: WorkChainNode) -> AttributeDict | None:
`AttributeDict | None`
The PDOS output node, if available.
"""
if not node:
return
if node.process_label == "QeAppWorkChain" and "pdos" in node.outputs:
return node.outputs.pdos
if "dos" in node.outputs and "projwfc" in node.outputs:
Expand All @@ -73,6 +75,8 @@ def extract_bands_output(node: WorkChainNode) -> AttributeDict | None:
`AttributeDict | None`
The bands output node, if available.
"""
if not node:
return
if node.process_label == "QeAppWorkChain" and "bands" in node.outputs:
outputs = node.outputs.bands
else:
Expand Down

0 comments on commit a5f3156

Please sign in to comment.