Make WordPress Core

Changeset 48876


Ignore:
Timestamp:
08/27/2020 01:56:39 AM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/comment-reply.js

    r48650 r48876  
    409409        var temporaryElement = getElementById( temporaryFormId );
    410410        var replyElement = getElementById( config.commentReplyTitleId );
    411         var initialHeadingText = ( 'undefined' !== typeof replyElement ) ? replyElement.firstChild.textContent : '';
     411        var initialHeadingText = replyElement ? replyElement.firstChild.textContent : '';
    412412
    413413        if ( temporaryElement ) {
Note: See TracChangeset for help on using the changeset viewer.