diff --git a/src/wp-includes/comment-functions.php b/src/wp-includes/comment-functions.php index 2c399e7c43..949453e159 100644 --- a/src/wp-includes/comment-functions.php +++ b/src/wp-includes/comment-functions.php @@ -1737,7 +1737,7 @@ function wp_new_comment_notify_postauthor( $comment_ID ) { } // Only send notifications for approved comments. - if ( 'spam' === $comment->comment_approved || ! $comment->comment_approved ) { + if ( ! isset( $comment->comment_approved ) || 'spam' === $comment->comment_approved || ! $comment->comment_approved ) { return false; }