diff --git a/src/Model/Results/Results.py b/src/Model/Results/Results.py index 3219c21fe251548535bd938fd078070eb03abfd9..4e5f9bf7b33926fc7511c939b9d647bba90d0d5c 100644 --- a/src/Model/Results/Results.py +++ b/src/Model/Results/Results.py @@ -56,6 +56,10 @@ class Results(object): def set(self, key, value): self._meta_data[key] = value + @property + def is_valid(self): + return ("timestamps" in self._meta_data) + def get(self, key): return self._meta_data[key] diff --git a/src/View/InitialConditions/Window.py b/src/View/InitialConditions/Window.py index d7cac0ffb99faa4cd464da37044615ae6e65cd01..e96e663a3f85edac61b1a16e7d2b856171676d42 100644 --- a/src/View/InitialConditions/Window.py +++ b/src/View/InitialConditions/Window.py @@ -301,7 +301,7 @@ class InitialConditionsWindow(PamhyrWindow): ) dlg.exec_() results = self._tmp_results - if "timestamps" in results._meta_data: + if results.is_valid: self._import_from_results(results) def _import_from_results(self, results): diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index a94fef1ac8f2f7dd2bf62f6f68c9b012c8b13e7c..9419699957f188ef332afd97feb31b283d83860b 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -1432,6 +1432,10 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): if results is None: return + # results does not have values, for example if geometry missmatch + if not results.is_valid: + return + # Windows already opened if self.sub_window_exists( ResultsWindow,