Fix bugs when trying to handle a Sku that no longer exists in the db.
This commit is contained in:
parent
118ebf679e
commit
6bd159bcfd
1 changed files with 3 additions and 2 deletions
|
|
@ -175,7 +175,7 @@ sub getSku {
|
|||
my ($self) = @_;
|
||||
my $asset = '';
|
||||
$asset = WebGUI::Asset->newByDynamicClass($self->cart->session, $self->get("assetId"));
|
||||
$asset->applyOptions($self->get("options"));
|
||||
$asset->applyOptions($self->get("options")) if $asset;
|
||||
return $asset;
|
||||
}
|
||||
|
||||
|
|
@ -229,7 +229,8 @@ Removes this item from the cart and calls $sku->onRemoveFromCart. See also delet
|
|||
|
||||
sub remove {
|
||||
my $self = shift;
|
||||
$self->getSku->onRemoveFromCart($self);
|
||||
my $sku = $self->getSku;
|
||||
$sku->onRemoveFromCart($self) if $sku;
|
||||
return $self->delete;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue