From d755c6485d574072f1bb4e49b486387da274be88 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Thu, 9 Jun 2022 13:18:35 -0500 Subject: [PATCH] Throw for featured apps not array --- helpers/structured-data.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helpers/structured-data.js b/helpers/structured-data.js index a4800fd..126aafc 100644 --- a/helpers/structured-data.js +++ b/helpers/structured-data.js @@ -5,6 +5,12 @@ function makeFeaturedAppsString ( featuredApps ) { export function buildVideoStructuredData ( video, featuredApps, options ) { // console.log('video', video) + // Throw for missing featured apps + if ( Array.isArray(featuredApps) === false ) { + console.warn( 'featuredApps not array', featuredApps ) + throw new Error('featuredApps must be an array of objects') + } + const { siteUrl } = options