From 6c8f681b43848c780c51c53613b795b64b864220 Mon Sep 17 00:00:00 2001 From: Wilmer Uruchi Ticona Date: Wed, 8 Apr 2020 17:46:41 +0200 Subject: [PATCH] Fixed #517 Added validation for graph in job list. --- autosubmit/job/job_list.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/autosubmit/job/job_list.py b/autosubmit/job/job_list.py index 02cbd8079..101ce4d49 100644 --- a/autosubmit/job/job_list.py +++ b/autosubmit/job/job_list.py @@ -1237,17 +1237,18 @@ class JobList: # print(current_structure) Log.info("Updating structure persistence...") self.graph = transitive_reduction(self.graph) - for job in self._job_list: - children_to_remove = [ - child for child in job.children if child.name not in self.graph.neighbors(job.name)] - for child in children_to_remove: - job.children.remove(child) - child.parents.remove(job) - try: - DbStructure.save_structure( - self.graph, self.expid, self._config.LOCAL_ROOT_DIR) - except Exception as exp: - pass + if self.graph: + for job in self._job_list: + children_to_remove = [ + child for child in job.children if child.name not in self.graph.neighbors(job.name)] + for child in children_to_remove: + job.children.remove(child) + child.parents.remove(job) + try: + DbStructure.save_structure( + self.graph, self.expid, self._config.LOCAL_ROOT_DIR) + except Exception as exp: + pass for job in self._job_list: if not job.has_parents() and new: -- GitLab