Comments: Correct the check for reply element existence in comment-reply.js
.
`document.getElementById()` returns `null` if no matching element was found, so the previous comparison didn't work as expected. Follow-up to [47506]. Props mailnew2ster, sarahricker. Fixes #38009. git-svn-id: https://develop.svn.wordpress.org/trunk@48876 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c77798da22
commit
3066546426
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user