Skip to content

Commit

Permalink
🐛 fix(VendorProductReview.php): add a check to ensure that the commen…
Browse files Browse the repository at this point in the history
…t exists before proceeding with further logic to prevent errors
  • Loading branch information
nurul-umbhiya committed Nov 10, 2023
1 parent 7645184 commit bdfa972
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/Emails/VendorProductReview.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public function trigger( $comment_id ) {
}

$comment = get_comment( $comment_id );
if ( ! $comment ) {
// the comment does not exist
return;
}

$product = wc_get_product( $comment->comment_post_ID );
if ( ! $product ) {
Expand Down

0 comments on commit bdfa972

Please sign in to comment.