Skip to content

Commit

Permalink
Fix AttributeError when current job is None
Browse files Browse the repository at this point in the history
  • Loading branch information
markwal committed Nov 19, 2016
1 parent cc6f0ba commit 0c86599
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion octoprint_GPX/gpxprinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def write(self, data):
currentJob = self._printer.get_current_job()
try:
build_name = currentJob["file"]["name"]
build_name = os.path.splitext(os.path.basename(build_name))[0]
build_name = os.path.splitext(os.path.basename(build_name))[0] if build_name else "OctoPrint"
except KeyError:
build_name = "OctoPrint"
gpx.write('(@build "%s")' % build_name)
Expand Down

0 comments on commit 0c86599

Please sign in to comment.