Skip to content

Commit

Permalink
Merge pull request #100 from ulitol97/master
Browse files Browse the repository at this point in the history
Extra checks to prevent invalid results.
  • Loading branch information
ulitol97 authored May 12, 2022
2 parents ceaa86b + a41b9f3 commit d287cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shapeMap/ShowShapeMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function ShowShapeMap({
// If we have several results, merge them all together to a single array of items.
function mkTableItems() {
return results
.filter((it) => !!it.shapeMap) // Filter results with valid shapeMap
.filter((it) => !!it.shapeMap && Array.isArray(it.shapeMap)) // Filter results with valid shapeMap (it exists and it's an array)
.reduce((prevItems, curr, idx) => {
// Make the items out of each result
const newItems = curr.shapeMap.map((item, index) => ({
Expand Down

0 comments on commit d287cea

Please sign in to comment.