From f89537458779942efadf600ce722b81be2bed15c Mon Sep 17 00:00:00 2001 From: Jakob Schnell Date: Mon, 15 Jan 2024 10:03:07 +0100 Subject: [PATCH] fix: TypeError if no SVGPaths are set (#212) Users may not have SVG Paths set, which leads to the Error described. --- CHANGELOG.md | 5 +++++ ORStools/gui/ORStoolsDialog.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a082b4..0362d711 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,11 @@ RELEASING: 13. Create new release in GitHub with tag version and release title of `vX.X.X` --> +## Unreleased + +### Fixed +- TypeError if no SVGPaths are set ([#212](https://github.com/GIScience/orstools-qgis-plugin/issues/212)) + ## [1.7.0] - 2023-12-22 ### Added diff --git a/ORStools/gui/ORStoolsDialog.py b/ORStools/gui/ORStoolsDialog.py index baeb6619..bb6652d1 100644 --- a/ORStools/gui/ORStoolsDialog.py +++ b/ORStools/gui/ORStoolsDialog.py @@ -247,7 +247,7 @@ def run_gui_control(self): # add ors svg path my_new_path = os.path.join(basepath, "img/svg") - svg_paths = QSettings().value("svg/searchPathsForSVG") + svg_paths = QSettings().value("svg/searchPathsForSVG") or [] if my_new_path not in svg_paths: svg_paths.append(my_new_path) QSettings().setValue("svg/searchPathsForSVG", svg_paths)