Skip to content

Commit

Permalink
Prevent type-casting warning when a Product has no price.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Jun 23, 2010
1 parent 05a19ff commit 321f165
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/WebGUI/Asset/Wobject/Shelf.pm
Expand Up @@ -336,7 +336,7 @@ sub view {
my $sku = $asset->get;
$sku->{url} = $asset->getUrl;
$sku->{thumbnailUrl} = $asset->getThumbnailUrl;
$sku->{price} = sprintf("%.2f", $asset->getPrice);
$sku->{price} = sprintf("%.2f", $asset->getPrice ? $asset->getPrice : 0);
$sku->{addToCartForm} = $asset->getAddToCartForm;
push @skus, $sku;
}
Expand Down

0 comments on commit 321f165

Please sign in to comment.