Skip to content

Commit 3a2fa90

Browse files
authored
Prevent PHP Warning (#2238)
1 parent ebf617c commit 3a2fa90

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

includes/functions.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,12 @@ function get_comment_ancestors( $comment ) {
987987
$ancestors[] = $id;
988988

989989
while ( $id > 0 ) {
990-
$ancestor = \get_comment( $id );
990+
$ancestor = \get_comment( $id );
991+
992+
if ( ! $ancestor ) {
993+
break;
994+
}
995+
991996
$parent_id = (int) $ancestor->comment_parent;
992997

993998
// Loop detection: If the ancestor has been seen before, break.

0 commit comments

Comments
 (0)