Skip to content

Commit

Permalink
Fixed: Importing nameless routes as untitled instead of crash
Browse files Browse the repository at this point in the history
  • Loading branch information
amitzkus committed Mar 10, 2024
1 parent a960d13 commit 71175a9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gpx_blender/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author" : "zuggamasta",
"description" : "",
"blender" : (4, 0, 2),
"version" : (0, 1, 1),
"version" : (0, 1, 2),
"location" : "",
"tracker_url": "https://github.com/zuggamasta/GPX-Importer/issues",
"warning" : "",
Expand Down Expand Up @@ -65,7 +65,13 @@ def read_gpx_data(context, filepath, use_create_edges, plot_elevation):

xml = parse(filepath)
trkpts = xml.getElementsByTagName("trkpt")
routename = xml.getElementsByTagName("name")[0].firstChild.nodeValue

try:
routename = xml.getElementsByTagName("name")[0].firstChild.nodeValue
except:
print("No route name found.")

routename = "untitled route"

try:
print("Importing: " + routename + " ...",end=' ')
Expand Down

0 comments on commit 71175a9

Please sign in to comment.