Skip to content

Commit

Permalink
Merge pull request #1 from eea/walkaround
Browse files Browse the repository at this point in the history
Easy walkaround to a bug that makes a country factsheet to crash
  • Loading branch information
silviubogan authored Oct 21, 2020
2 parents 86f8551 + 51a9b1a commit 9c0ab1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Block/TocView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const View = (props) => {
: [1, 2, 3, 4, 5, 6];
const tocEntries = map(properties[blocksLayoutFieldname].items, (id) => {
const block = properties[blocksFieldname][id];
if (typeof block === 'undefined') {
return null;
}

if (!blocks.blocksConfig[block['@type']]?.tocEntry) return null;
const entry = blocks.blocksConfig[block['@type']]?.tocEntry(block, data);
return entry ? [...entry, id] : null;
Expand Down

0 comments on commit 9c0ab1d

Please sign in to comment.