diff --git a/AUTHORS.md b/AUTHORS.md index 13a7552e..3408d14f 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -72,6 +72,7 @@ date of first contribution): * [Ovidiu Hossu](https://github.com/MoonshineSG) * [Eyck Jentzsch](https://github.com/eyck) * [Mathias Rangel Wulff](https://github.com/mathiasrw) + * [Clemens Niemeyer](https://github.com/clemniem) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and diff --git a/src/octoprint/events.py b/src/octoprint/events.py index bcff3a73..3a1cbefe 100644 --- a/src/octoprint/events.py +++ b/src/octoprint/events.py @@ -386,7 +386,8 @@ class CommandTrigger(GenericEventListener): if "currentZ" in currentData.keys() and currentData["currentZ"] is not None: params["__currentZ"] = str(currentData["currentZ"]) - if "job" in currentData.keys() and currentData["job"] is not None: + if "job" in currentData and "file" in currentData["job"] and "name" in currentData["job"]["file"] \ + and currentData["job"]["file"]["name"] is not None: params["__filename"] = currentData["job"]["file"]["name"] params["__filepath"] = currentData["job"]["file"]["path"] params["__fileorigin"] = currentData["job"]["file"]["origin"]