Skip to content

Commit

Permalink
Sponsor Invoices: Don't attempt to unlink() a WP_Error instance whe…
Browse files Browse the repository at this point in the history
…n we fail to fetch the invoice.
  • Loading branch information
dd32 authored Jan 6, 2025
1 parent ec6fefa commit 3a08a0d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ function notify_organizer_status_changed( $invoice_id, $new_status ) {

wp_mail( $to, $subject, $message, $headers, $attachments );

if ( $invoice_filename ) {
if ( $invoice_filename && ! is_wp_error( $invoice_filename ) ) {
unlink( $invoice_filename );
}
}
Expand Down

0 comments on commit 3a08a0d

Please sign in to comment.