From 4b3e9c5a297f4c16b6d6d1bc18d13a5af1d7df4c Mon Sep 17 00:00:00 2001 From: Martin Heidegger Date: Mon, 15 Jun 2015 11:11:52 +0900 Subject: [PATCH] Fixing error with missing .Props file `zip.file` uses `wb.Props` but if `.Props` is undefined it will throw an error. Seems like the safeguard from a few lines below should be before `zip.file` --- xlsx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlsx.js b/xlsx.js index c29f5ce..b28055c 100644 --- a/xlsx.js +++ b/xlsx.js @@ -11299,12 +11299,12 @@ function write_zip(wb, opts) { get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}}); f = "docProps/core.xml"; + if(!wb.Props) wb.Props = {}; zip.file(f, write_core_props(wb.Props, opts)); ct.coreprops.push(f); add_rels(opts.rels, 2, f, RELS.CORE_PROPS); f = "docProps/app.xml"; - if(!wb.Props) wb.Props = {}; wb.Props.SheetNames = wb.SheetNames; wb.Props.Worksheets = wb.SheetNames.length; zip.file(f, write_ext_props(wb.Props, opts)); -- 2.34.1