diff --git a/tools/importer/import-news-press-healthythinking.js b/tools/importer/import-news-press-healthythinking.js index d4e550b2..e5701c69 100644 --- a/tools/importer/import-news-press-healthythinking.js +++ b/tools/importer/import-news-press-healthythinking.js @@ -58,11 +58,14 @@ const createFragmentBlockFromSection = (document) => { block.push(['https://main--sunstar--hlxsites.hlx.page/fragments/featured-articles']); section = newsPressCard; } - const table = WebImporter.DOMUtils.createTable(block, document); - section.before(document.createElement('hr')); - section.before(document.querySelector('.slider-title')); - section.after(document.createElement('hr')); - section.replaceWith(table); + + if (section) { + const table = WebImporter.DOMUtils.createTable(block, document); + section.before(document.createElement('hr')); + section.before(document.querySelector('.slider-title')); + section.after(document.createElement('hr')); + section.replaceWith(table); + } }; const addSocialBlock = (document) => {