Skip to content

Commit d665f5a

Browse files
timlinuxgiohappy
andauthored
Fix #311 : Exception when dealing with malformed SLD (#312)
* Fix #311 : Exception when dealing with malformed SLD * Fix #311 : Address formatting issues --------- Co-authored-by: Giovanni Allegri <giovanni.allegri@gmail.com>
1 parent 0d689b4 commit d665f5a

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,6 @@ dmypy.json
134134
# Development
135135
.idea/
136136
.vscode/
137+
# Generated files
138+
src/qgis_geonode/metadata.txt
139+
src/qgis_geonode/resources.py

src/qgis_geonode/utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ def remove_comments_from_sld(element):
5454
def url_from_geoserver(base_url: str, raw_url: str):
5555

5656
# Clean the URL path from trailing and back slashes
57-
url_path = urlparse(raw_url).path.strip("/")
57+
try:
58+
url_path = urlparse(raw_url).path.strip("/")
59+
except TypeError:
60+
QgsMessageLog.logMessage(
61+
"Incorrect type returned from GeoServer",
62+
"GeoNode",
63+
Qgis.Warning)
64+
return None
5865

5966
url_path = url_path.split("/")
6067
# re-join URL path without the geoserver path

0 commit comments

Comments
 (0)