diff --git a/src/CartItem.php b/src/CartItem.php index 0717ed7..e5ac8ac 100644 --- a/src/CartItem.php +++ b/src/CartItem.php @@ -97,6 +97,9 @@ class CartItem implements Arrayable, Jsonable if (strlen($price) < 0 || !is_numeric($price)) { throw new \InvalidArgumentException('Please supply a valid price.'); } + if (strlen($weight) < 0 || !is_numeric($weight)) { + throw new \InvalidArgumentException('Please supply a valid weight.'); + } $this->id = $id; $this->name = $name;