Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 1859849

Browse files
committed
Fix to handle extra #enddocregion tags
1 parent 4d2ac96 commit 1859849

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

public/doc-shredder/regionExtractor.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ module.exports = function regionExtractor() {
2525
lines[ix] = nullLine;
2626
docs.push(doc);
2727
} else if (hasEndRegionTag(line)) {
28-
lines[ix] = nullLine;
29-
doc.endIx = ix;
30-
doc = docStack.pop();
28+
if (doc) {
29+
lines[ix] = nullLine;
30+
doc.endIx = ix;
31+
doc = docStack.pop();
32+
}
3133
}
3234
}
3335
});

0 commit comments

Comments
 (0)