Fixed a problem where getShippingAddress was not throwing an error but still returning undef in some situations causing the cart to fail.

This commit is contained in:
Frank Dillon 2008-11-15 18:12:30 +00:00
parent 8e069753c2
commit d6b69e789c

View file

@ -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);
}