aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2021-01-09 13:33:55 +0000
committerMichael Williamson <mike@zwobble.org>2021-01-09 13:33:55 +0000
commitf141817b947e36a9db7c56600c5031de32bb0fb9 (patch)
tree5e67a825958d6afe8fdd6c342bad3773acef6428 /lib
parent0846021e12acb348fa0693e9aedfe99f685e3838 (diff)
Ensure we don't use null style ID for finding numbering
This should be redundant since we filter out nulls as keys.
Diffstat (limited to 'lib')
-rw-r--r--lib/docx/body-reader.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js
index 2979a38..2616dde 100644
--- a/lib/docx/body-reader.js
+++ b/lib/docx/body-reader.js
@@ -499,9 +499,11 @@ function BodyReader(options) {
function readNumberingProperties(styleId, element, numbering) {
- var levelByStyleId = numbering.findLevelByParagraphStyleId(styleId);
- if (levelByStyleId != null) {
- return levelByStyleId;
+ if (styleId != null) {
+ var levelByStyleId = numbering.findLevelByParagraphStyleId(styleId);
+ if (levelByStyleId != null) {
+ return levelByStyleId;
+ }
}
var level = element.firstOrEmpty("w:ilvl").attributes["w:val"];