ShipmentPacker chokes with NoMethodError: undefined method `[]' for nil:NilClass #57

Open
jduff opened this Issue Aug 4, 2012 · 1 comment

Projects

None yet

2 participants

@jduff
Contributor
jduff commented Aug 4, 2012

This happens when the array of items passed in is empty.

Contributor

Do we have any replication steps for this?

@kknd113 kknd113 pushed a commit to dotandbo/active_shipping that referenced this issue May 12, 2015
@TylerRick @radar TylerRick + radar When Spree::ActiveShipping::Config[:shipper_number] is "", an empty S…
…hipperNumber node is added to the request, resulting in a "Missing/Invalid Shipper/ShipperNumber" error response from UPS.

By adding .presence, we can have it treat a "" value as nil so that it will skip adding the
ShipperNumber node when shipper_number is "" instead of treating "" as a truthy value.

Fixes #57
c85c26b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment