aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-05-24 09:46:11 +0100
committerMichael Williamson <mike@zwobble.org>2015-05-24 09:46:11 +0100
commit963a9c2101a18803ddd8be195cecef70919cfa4d (patch)
tree6f24df9c034d7713e70a516446bc3921faaa9ea2 /lib
parentd0542bf7055343ff01fbe698ec25a117c4c5be36 (diff)
parent60d6d9e584c44c3beae16110b6685a0a86bc38b4 (diff)
Merge remote-tracking branch 'jaceyshome/master'
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..3419ac4 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;
+}