aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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;
+}