From a4afe3c01c1035f8da490503917c419e1aa2eb5a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 12 Sep 2015 14:02:49 +0100 Subject: Fix race condition --- lib/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/index.js b/lib/index.js index 69ab111..ae95371 100644 --- a/lib/index.js +++ b/lib/index.js @@ -96,9 +96,10 @@ function convertElementToRawText(element) { function embedStyleMap(input, styleMap) { return unzip.openZip(input) + .tap(function(docxFile) { + return docxStyleMap.writeStyleMap(docxFile, styleMap); + }) .then(function(docxFile) { - docxStyleMap.writeStyleMap(docxFile, styleMap); - return { toBuffer: docxFile.toBuffer }; -- cgit v1.2.3