fix getAttribute exception in notes plugin #3285

This commit is contained in:
hakimel 2022-10-17 08:51:44 +02:00
parent 468132320d
commit fb68f1c389
3 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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 ), '*' );