Skip to content

Commit

Permalink
fix getAttribute exception in notes plugin #3285
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Oct 17, 2022
1 parent 4681323 commit fb68f1c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin/notes/notes.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/notes/notes.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/notes/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const Plugin = () => {
// Look for notes defined in an aside element
if( notesElements ) {
messageData.notes = Array.from(notesElements).map( notesElement => notesElement.innerHTML ).join( '\n' );
messageData.markdown = typeof notesElements[0].getAttribute( 'data-markdown' ) === 'string';
messageData.markdown = notesElements[0] && typeof notesElements[0].getAttribute( 'data-markdown' ) === 'string';
}

speakerWindow.postMessage( JSON.stringify( messageData ), '*' );
Expand Down

0 comments on commit fb68f1c

Please sign in to comment.