Fix undefined var in recent change for new comment

With the recent changes module, adding a recent change for a new comment
caused the warning "Undefined variable $comment_thread" if the comment
was not a reply. Use `isset()` instead of `!== NULL` to check for reply
depth, avoiding the warning when $comment_thread is not set.
This commit is contained in:
Benjamin Spiegel 2023-05-21 23:34:00 -05:00
parent ed4bda5ebc
commit ff437562e3
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ register_module([
"timestamp" => time(),
"page" => $env->page,
"user" => $env->user,
"reply_depth" => $comment_thread !== null ? count($comment_thread) : 0,
"reply_depth" => isset($comment_thread) ? count($comment_thread) : 0,
"comment_id" => $new_comment->id
]);
}