Skip to content

Commit f8b2344

Browse files
authored
Avoid PHP Notices when a Comment parent is unavailable.
1 parent 6d7bf5f commit f8b2344

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

inc/fragment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ public static function get_fragment_from_comment( $my_comment ) {
400400

401401
public static function get_depth_for_comment( $my_comment ) {
402402
$depth = 1;
403-
while ( 0 < $my_comment->comment_parent ) {
403+
while ( $my_comment && 0 < $my_comment->comment_parent ) {
404404
$depth = $depth + 1;
405405
$my_comment = get_comment( $my_comment->comment_parent );
406406
}

0 commit comments

Comments
 (0)