From 83038c7632cb2d4897896ceb1a40f41026831da1 Mon Sep 17 00:00:00 2001 From: signedav Date: Mon, 25 Sep 2023 13:48:45 +0200 Subject: [PATCH] stable against ilidata: entry as path --- QgisModelBaker/gui/validate.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/QgisModelBaker/gui/validate.py b/QgisModelBaker/gui/validate.py index fc6f90d0f..6998f2dcf 100644 --- a/QgisModelBaker/gui/validate.py +++ b/QgisModelBaker/gui/validate.py @@ -674,14 +674,22 @@ def _load_config_file(self): self.config_file_line_edit.setText(self._relative_path(filename)) def _relative_path(self, path): - if QgsProject.instance().homePath() and os.path.isabs(path): + if ( + os.path.isfile(path) + and QgsProject.instance().homePath() + and os.path.isabs(path) + ): # if it's a saved project and the path is not (yet) relative return os.path.relpath(path, QgsProject.instance().homePath()) else: return path def _absolute_path(self, path): - if path and QgsProject.instance().homePath() and not os.path.isabs(path): + if ( + os.path.isfile(path) + and QgsProject.instance().homePath() + and not os.path.isabs(path) + ): # if it's a saved project and the path is not not absolute return os.path.join(path, QgsProject.instance().homePath(), path) else: