From 1ec4773ad38fd45b85e5321a46d2a258bda9c404 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 9 Jan 2024 22:16:37 +1100 Subject: [PATCH] Fixes for tests --- tests/Feature/ProductTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Feature/ProductTest.php b/tests/Feature/ProductTest.php index 2bdd330f198e..40af31f9a9cc 100644 --- a/tests/Feature/ProductTest.php +++ b/tests/Feature/ProductTest.php @@ -100,7 +100,7 @@ class ProductTest extends TestCase foreach ($line_items as $key => $item) { - if($item?->product_cost == 0 && $product = Product::where('company_id', $invoice->company_id)->where('product_key', $item->product_key)->where('cost', '>', 0)->first()) { + if(property_exists($item, 'product_cost') && $item->product_cost == 0 && $product = Product::where('company_id', $invoice->company_id)->where('product_key', $item->product_key)->where('cost', '>', 0)->first()) { $line_items[$key]->product_cost = $product->cost; } }