From 0a5185a4103b713e521122041c6df983f99c1c44 Mon Sep 17 00:00:00 2001 From: justanotheranonymoususer Date: Mon, 17 Aug 2020 12:27:47 +0300 Subject: [PATCH 1/2] Update comment-reply.js --- src/js/_enqueues/lib/comment-reply.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/lib/comment-reply.js b/src/js/_enqueues/lib/comment-reply.js index 1f111230c9345..d86403bbeb9fd 100644 --- a/src/js/_enqueues/lib/comment-reply.js +++ b/src/js/_enqueues/lib/comment-reply.js @@ -408,7 +408,7 @@ window.addComment = ( function( window ) { var temporaryFormId = config.temporaryFormId; var temporaryElement = getElementById( temporaryFormId ); var replyElement = getElementById( config.commentReplyTitleId ); - var initialHeadingText = ( 'undefined' !== typeof replyElement ) ? replyElement.firstChild.textContent : ''; + var initialHeadingText = replyElement ? replyElement.firstChild.textContent : ''; if ( temporaryElement ) { // The element already exists, no need to recreate. From dfe1f224c693ba527c6eb4efb87db5a4f2d48626 Mon Sep 17 00:00:00 2001 From: justanotheranonymoususer Date: Fri, 28 Aug 2020 15:47:04 +0300 Subject: [PATCH 2/2] Update comment-reply.js --- src/js/_enqueues/lib/comment-reply.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/lib/comment-reply.js b/src/js/_enqueues/lib/comment-reply.js index d86403bbeb9fd..88bdcc6eee4e4 100644 --- a/src/js/_enqueues/lib/comment-reply.js +++ b/src/js/_enqueues/lib/comment-reply.js @@ -337,7 +337,7 @@ window.addComment = ( function( window ) { cancelElement.style.display = ''; addBelowElement.parentNode.insertBefore( respondElement, addBelowElement.nextSibling ); - if ( replyHeadingTextNode.nodeType === Node.TEXT_NODE ) { + if ( replyHeadingTextNode && replyHeadingTextNode.nodeType === Node.TEXT_NODE ) { replyHeadingTextNode.textContent = replyTo; } /*