From 7a93035d6a25990628d0c5477984fa4c044be8e2 Mon Sep 17 00:00:00 2001 From: Edan Bainglass <45081142+edan-bainglass@users.noreply.github.com> Date: Sat, 4 Jan 2025 11:40:23 +0100 Subject: [PATCH] Guard against null process states (#658) This PR adds a check for null (`None`) process states when used in updating `NodesTreeWidget` nodes, bailing if unavailable. --- aiidalab_widgets_base/nodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aiidalab_widgets_base/nodes.py b/aiidalab_widgets_base/nodes.py index f08b9af84..68e76d9ab 100644 --- a/aiidalab_widgets_base/nodes.py +++ b/aiidalab_widgets_base/nodes.py @@ -283,6 +283,8 @@ def _walk_tree(cls, root): def _update_tree_node(self, tree_node): if isinstance(tree_node, AiidaProcessNodeTreeNode): process_node = orm.load_node(tree_node.pk) + if process_node.process_state is None: + return tree_node.name = calc_info(process_node) # Override the process state in case that the process node has failed: # (This could be refactored with structural pattern matching with py>=3.10.)