Skip to content

Commit 6bc970a

Browse files
committed
fix: wooCommerce access product validation added
1 parent 09f76ac commit 6bc970a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

includes/Triggers/WC/WCHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace BitCode\FI\Triggers\WC;
44

5-
use WC_Product_Booking;
65
use BitCode\FI\Core\Util\Helper;
6+
use WC_Product_Booking;
77

88
class WCHelper
99
{
@@ -265,6 +265,10 @@ public static function accessOrderData($order)
265265

266266
public static function accessProductData($product)
267267
{
268+
if (empty($product)) {
269+
return [];
270+
}
271+
268272
$productId = $product->get_id();
269273
$imageUrl = wp_get_attachment_image_url($product->get_image_id(), 'full');
270274
$imageIds = $product->get_gallery_image_ids();

0 commit comments

Comments
 (0)