From 6b8fe36caf729eae5e2bc40a831965d6265e0cd6 Mon Sep 17 00:00:00 2001 From: Victor Almeida Date: Mon, 12 Dec 2022 09:20:56 -0300 Subject: [PATCH 1/2] Handle null item inside sellers' array --- CHANGELOG.md | 2 ++ react/components/ReviewBlock.tsx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eded3df3..bbbc56e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +- Fix ReviewBlock filter to handle null item inside sellers' array + ## [3.12.3] - 2022-11-23 ### Added diff --git a/react/components/ReviewBlock.tsx b/react/components/ReviewBlock.tsx index e6db8adf..af05a58c 100644 --- a/react/components/ReviewBlock.tsx +++ b/react/components/ReviewBlock.tsx @@ -131,8 +131,8 @@ const ReviewBlock: FunctionComponent = ({ if (!item.sellers) return item.sellers = item.sellers.filter( (seller: any) => - seller.availability === 'available' || - seller.availability === 'partiallyAvailable' + seller?.availability === 'available' || + seller?.availability === 'partiallyAvailable' ) }) From 66492bfee66197c701f320ac4c767afde72d1505 Mon Sep 17 00:00:00 2001 From: Victor Almeida Date: Mon, 12 Dec 2022 09:31:07 -0300 Subject: [PATCH 2/2] Fix changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbbc56e6..7089f601 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed + - Fix ReviewBlock filter to handle null item inside sellers' array ## [3.12.3] - 2022-11-23