Prevent emitting two successive errors when outputting to a zip file