Saving workspace now works when there are no meshes to save

CURA-1263
This commit is contained in:
Jaime van Kessel 2016-11-10 11:29:47 +01:00
parent 61d1199abf
commit 3ab283bfed

View file

@ -20,7 +20,10 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
# Indicate that the 3mf mesh writer should not close the archive just yet (we still need to add stuff to it).
mesh_writer.setStoreArchive(True)
mesh_writer.write(stream, nodes, mode)
archive = mesh_writer.getArchive()
if archive is None: # This happens if there was no mesh data to write.
archive = zipfile.ZipFile(stream, "w", compression = zipfile.ZIP_DEFLATED)
global_container_stack = Application.getInstance().getGlobalContainerStack()