aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjaceyshome <jaceyshome@gmail.com>2015-05-21 21:14:15 +1000
committerjaceyshome <jaceyshome@gmail.com>2015-05-21 21:14:15 +1000
commitc608d035569e16c81ea29ecf2a904e227379cecd (patch)
treee969ba13a64710c29fc9167d5950619e0b9dacc4 /lib
parent969d80c62e7d5d5ed41a3dc7ec8f5f8bdec59a91 (diff)
styles names should be null by default
Diffstat (limited to 'lib')
-rw-r--r--lib/docx/styles-reader.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/docx/styles-reader.js b/lib/docx/styles-reader.js
index dc90bc1..fec1cf2 100644
--- a/lib/docx/styles-reader.js
+++ b/lib/docx/styles-reader.js
@@ -36,6 +36,11 @@ function readStylesXml(xml) {
function readStyleElement(styleElement) {
var type = styleElement.attributes["w:type"];
var styleId = styleElement.attributes["w:styleId"];
- var name = styleElement.first("w:name").attributes["w:val"];
+ var name = styleName(styleElement);
return {type: type, styleId: styleId, name: name};
}
+
+function styleName(styleElement) {
+ var nameElement = styleElement.first("w:name");
+ return nameElement ? nameElement.attributes["w:val"] : null;
+}