Don't let the cart crash on invalid addressIds
This commit is contained in:
parent
f748aa1b83
commit
10ea82d6ec
3 changed files with 27 additions and 3 deletions
|
|
@ -1174,7 +1174,10 @@ sub www_view {
|
|||
|
||||
my $billingAddressId = $self->get('billingAddressId');
|
||||
if ($billingAddressId) {
|
||||
$billingAddressOptions{'update_address'} = sprintf $i18n->get('Update %s'), $self->getBillingAddress->get('label');
|
||||
my $billingAddress = eval { $self->getBillingAddress };
|
||||
if ( defined $billingAddress ) {
|
||||
$billingAddressOptions{'update_address'} = sprintf $i18n->get('Update %s'), $billingAddress->get('label');
|
||||
}
|
||||
}
|
||||
|
||||
%billingAddressOptions = (%billingAddressOptions, %addressOptions);
|
||||
|
|
@ -1190,7 +1193,10 @@ sub www_view {
|
|||
|
||||
my $shippingAddressId = $self->get('shippingAddressId');
|
||||
if ($shippingAddressId) {
|
||||
$shippingAddressOptions{'update_address'} = sprintf $i18n->get('Update %s'), $self->getShippingAddress->get('label');
|
||||
my $shippingAddress = eval { $self->getShippingAddress };
|
||||
if ( defined $shippingAddress ) {
|
||||
$shippingAddressOptions{'update_address'} = sprintf $i18n->get('Update %s'), $shippingAddress->get('label');
|
||||
}
|
||||
}
|
||||
%shippingAddressOptions = (%shippingAddressOptions, %addressOptions);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue