Skip to content

Commit

Permalink
Merge pull request #149 from vtex-apps/fix/product-null
Browse files Browse the repository at this point in the history
Fix product image product evaluation (console errors)
  • Loading branch information
jgfidelis committed Apr 30, 2019
2 parents 21feed1 + 86edb68 commit bae2216
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [2.19.2] - 2019-04-30
### Fixed
- Fix `ProductImage` product evaluation.

## [2.19.1] - 2019-04-30
### Fixed
- Do not render `ProductPrice` when selling price is zero.
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"vendor": "vtex",
"name": "product-summary",
"version": "2.19.1",
"version": "2.19.2",
"title": "Product Summary",
"description": "Product summary component",
"defaultLocale": "pt-BR",
Expand Down
8 changes: 4 additions & 4 deletions react/legacy/components/ProductImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const ProductImage = ({
showCollections,
displayMode,
}) => {
if (!path(['sku', 'image', 'imageUrl'], product)) {
return <ImagePlaceholder />
}

const {
productClusters,
productName: name,
Expand All @@ -47,10 +51,6 @@ const ProductImage = ({
},
} = product

if (!path(['sku', 'image', 'imageUrl'], product)) {
return <ImagePlaceholder />
}

const imageClassName = classNames({
[productSummary.imageNormal]: displayMode !== 'inline',
[productSummary.imageInline]: displayMode === 'inline',
Expand Down

0 comments on commit bae2216

Please sign in to comment.