upgrade related fixes

This commit is contained in:
JT Smith 2008-06-12 22:24:07 +00:00
parent 9db78c074c
commit e3d85353e8
6 changed files with 45 additions and 13 deletions

View file

@ -132,8 +132,12 @@ Returns an instanciated WebGUI::Asset::Sku object for this item.
sub getSku {
my ($self) = @_;
my $asset = WebGUI::Asset->newByDynamicClass($self->transaction->session, $self->get("assetId"));
$asset->applyOptions($self->get("options"));
return $asset;
if (defined $asset) {
$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;
}
#-------------------------------------------------------------------