fix: error zipping zero-bytes files
Massimo Melina committed
Aug 29, 2022 at 11:24 UTC
58651ff05b3df7ede62757739c130730b7e3e828
1 file changed
+1
-1
src/zip.ts
+1
-1
@@ -47,7 +47,7 @@ export async function zipStreamFromFolder(node: VfsNode, ctx: Koa.Context) {
47
ts: st.mtime || st.ctime,
48
mode: st.mode,
49
sourcePath: source,
50
- getData: () => createReadStream(source, { start: 0 , end: st.size-1 })
50
+ getData: () => createReadStream(source, { start: 0 , end: Math.max(0, st.size-1) })
51
}
52
}
53
catch {}