diff --git a/src/js/_enqueues/lib/comment-reply.js b/src/js/_enqueues/lib/comment-reply.js index 723b532073..ea973f41e8 100644 --- a/src/js/_enqueues/lib/comment-reply.js +++ b/src/js/_enqueues/lib/comment-reply.js @@ -106,7 +106,9 @@ window.addComment = ( function( window ) { } }; - commentFormElement.addEventListener( 'keydown', submitFormHandler ); + if ( commentFormElement ) { + commentFormElement.addEventListener( 'keydown', submitFormHandler ); + } var links = replyLinks( context ); var element;