moltin / laravel-cart

Laravel Facade and Service Provider for Moltin\Cart
276 stars 87 forks source link

Fix: sometimes contents() returns mixed arrays with Item objects. #45

Open Namek opened 9 years ago

Namek commented 9 years ago

One of two exceptions appeared, depending on object/array order in result of contents() call:

  1. Trying to get property of non-object
  2. Call to a member function toArray() on array

This happens when contents() is called more than once.