From 6cbb89b1a153f139083b8d085cc66661148943ff Mon Sep 17 00:00:00 2001 From: Amir Khan Date: Wed, 14 Jun 2023 11:01:59 +0200 Subject: [PATCH] check if bcc is an array --- lib/sendgrid/class-sendgrid-translator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sendgrid/class-sendgrid-translator.php b/lib/sendgrid/class-sendgrid-translator.php index 862d318..bbf25f1 100644 --- a/lib/sendgrid/class-sendgrid-translator.php +++ b/lib/sendgrid/class-sendgrid-translator.php @@ -261,7 +261,7 @@ private static function set_bccs_v3( foreach ( $email_v2->bcc as $index => $address ) { // Check if "bcc name" is set $bcc_name = null; - if ( self::is_valid_string( $email_v2->bccName[ $index ] ) ) { + if ( is_array($email_v2->bccName) && self::is_valid_string( $email_v2->bccName[ $index ] ) ) { $bcc_name = trim( $email_v2->bccName[ $index ] ); }