Skip to content

Commit

Permalink
fix NPE in note map, closes #2877
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed May 27, 2022
1 parent daa3619 commit 8905148
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/api/note_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function findExcerpts(sourceNote, referencedNoteId) {

let centerEl = linkEl;

while (centerEl.tagName !== 'BODY' && centerEl.parentElement.textContent.length <= EXCERPT_CHAR_LIMIT) {
while (centerEl.tagName !== 'BODY' && centerEl.parentElement?.textContent?.length <= EXCERPT_CHAR_LIMIT) {
centerEl = centerEl.parentElement;
}

Expand Down

0 comments on commit 8905148

Please sign in to comment.