Skip to content

Commit f31d1d8

Browse files
authored
Fix productVariants method to handle null values
1 parent f03a9df commit f31d1d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Products/Productable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function price(): ?int
3737

3838
public function productVariants(): array
3939
{
40-
return $this->value('product_variants', []);
40+
return $this->value('product_variants') ?? [];
4141
}
4242

4343
public function stock(): ?int

0 commit comments

Comments
 (0)