Addon: Show error if the file path is not known before submitting

If file has never been saved, Flamenco cannot create a temp copy to
submit. This caused an exception, which is now avoided by showing a
clear error message instead.

Maniphest Tasks: T102192

Differential Revision: https://developer.blender.org/D16358
This commit is contained in:
Yann Doersam 2022-11-08 11:46:11 +01:00 committed by Sybren A. Stüvel
parent f75a8f4c65
commit 1cef0d48df

@ -161,6 +161,11 @@ class FLAMENCO_OT_submit_job(FlamencoOpMixin, bpy.types.Operator):
self.report({"WARNING"}, err)
return {"CANCELLED"}
if not context.blend_data.filepath:
# The file path needs to be known before the file can be submitted.
self.report({"ERROR"}, "Please save your .blend file before submitting to Flamenco")
return {"CANCELLED"}
filepath = self._save_blendfile(context)
# Check the job with the Manager, to see if it would be accepted.