diff --git a/lib/WebGUI/Shop/TransactionItem.pm b/lib/WebGUI/Shop/TransactionItem.pm index 60c2a37c8..ffa57cb59 100644 --- a/lib/WebGUI/Shop/TransactionItem.pm +++ b/lib/WebGUI/Shop/TransactionItem.pm @@ -134,11 +134,11 @@ sub getSku { my ($self) = @_; my $asset = eval { WebGUI::Asset->newById($self->transaction->session, $self->get("assetId")); }; if (Exception::Class->caught()) { - $asset->applyOptions($self->get("options")); - return $asset; + WebGUI::Error::ObjectNotFound->throw(error=>'SKU Asset '.$self->get('assetId').' could not be instanciated. Perhaps it no longer exists.', id=>$self->get('assetId')); + return undef; } - WebGUI::Error::ObjectNotFound->throw(error=>'SKU Asset '.$self->get('assetId').' could not be instanciated. Perhaps it no longer exists.', id=>$self->get('assetId')); - return undef; + $asset->applyOptions($self->get("options")); + return $asset; } #-------------------------------------------------------------------