From 8d4dade3baf2b0a6c392c223a81beffcfefc09d6 Mon Sep 17 00:00:00 2001 From: Sabbir Ahmed Date: Wed, 9 Sep 2020 15:23:34 +0600 Subject: [PATCH] fix: fatal error during new order email template --- includes/Emails/VendorNewOrder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/Emails/VendorNewOrder.php b/includes/Emails/VendorNewOrder.php index 4d6f317810..580ad9358f 100644 --- a/includes/Emails/VendorNewOrder.php +++ b/includes/Emails/VendorNewOrder.php @@ -202,6 +202,10 @@ public function init_form_fields() { * @return bool */ public function prevent_sub_order_admin_email( $bool, $order ) { + if ( ! $order ) { + return $bool; + } + if ( $order->get_parent_id() ) { return false; }