Explicitly set 0 if the cart is null.