Make WordPress Core

Ticket #48543: 48543.diff

File 48543.diff, 518 bytes (added by raamdev, 5 years ago)

Checks if commentFormElement is non-null before using it

  • trunk/src/js/_enqueues/lib/comment-reply.js

     
    106106                        }
    107107                };
    108108
    109                 commentFormElement.addEventListener( 'keydown', submitFormHandler );
     109                if ( commentFormElement ) {
     110                        commentFormElement.addEventListener( 'keydown', submitFormHandler );
     111                }
    110112
    111113                var links = replyLinks( context );
    112114                var element;