From d6b69e789c00b1bbd02204d004059d358f12023f Mon Sep 17 00:00:00 2001 From: Frank Dillon Date: Sat, 15 Nov 2008 18:12:30 +0000 Subject: [PATCH] Fixed a problem where getShippingAddress was not throwing an error but still returning undef in some situations causing the cart to fail. --- lib/WebGUI/Shop/Cart.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/WebGUI/Shop/Cart.pm b/lib/WebGUI/Shop/Cart.pm index d76db0db8..b04050c2a 100644 --- a/lib/WebGUI/Shop/Cart.pm +++ b/lib/WebGUI/Shop/Cart.pm @@ -805,14 +805,15 @@ sub www_view { ); # get the shipping address - my $address = eval { $self->getShippingAddress }; - if (WebGUI::Error->caught("WebGUI::Error::ObjectNotFound")) { + my $address = eval { $self->getShippingAddress }; + if (my $e = WebGUI::Error->caught("WebGUI::Error::ObjectNotFound")) { # choose another address cuz we've got a problem $self->update({shippingAddressId=>''}); + } # if there is no shipping address we can't check out - if (WebGUI::Error->caught) { + if (WebGUI::Error->caught || not defined $address) { $var{shippingPrice} = $var{tax} = $self->formatCurrency(0); }