From 3a08a0d10ec538aeed4e7fe7a48f8ea97cb5e839 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 6 Jan 2025 15:53:49 +1000 Subject: [PATCH] Sponsor Invoices: Don't attempt to unlink() a `WP_Error` instance when we fail to fetch the invoice. --- .../includes/sponsor-invoices-dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/wp-content/plugins/wordcamp-payments-network/includes/sponsor-invoices-dashboard.php b/public_html/wp-content/plugins/wordcamp-payments-network/includes/sponsor-invoices-dashboard.php index 18327f4cff..350bd17608 100644 --- a/public_html/wp-content/plugins/wordcamp-payments-network/includes/sponsor-invoices-dashboard.php +++ b/public_html/wp-content/plugins/wordcamp-payments-network/includes/sponsor-invoices-dashboard.php @@ -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 ); } }