From 5efddd9cf4a35dba0afbb27876c55f1396003c78 Mon Sep 17 00:00:00 2001 From: KRehberg <47893674+krehberg-apalis@users.noreply.github.com> Date: Fri, 28 Mar 2025 10:37:51 +0100 Subject: [PATCH] Update SendEmail.php - Handle getMethod() on null when PaymentMethod not set yet --- Plugin/SendEmail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugin/SendEmail.php b/Plugin/SendEmail.php index faf36a69c..c0c6b29e3 100644 --- a/Plugin/SendEmail.php +++ b/Plugin/SendEmail.php @@ -56,7 +56,7 @@ public function __construct( */ public function afterSetState(Order $subject, Order $result, string $state) { - if ($subject->getPayment()->getMethod() == Config::CODE) { + if ($subject->getPayment()?->getMethod() == Config::CODE) { if ($this->scopeConfig->getValue('sales_email/order/enabled')) { $subject->setCanSendNewEmailFlag(false);