From c82318d4c5cd661a40a4b21038c1f5bb4ca1ea1e Mon Sep 17 00:00:00 2001 From: Fredrik Strand Oseberg Date: Tue, 16 Aug 2022 13:39:20 +0200 Subject: [PATCH] fix: check variants before mapping (#1922) * fix: check variants before mapping * fix: default to empty array --- src/lib/util/offline-unleash-client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/util/offline-unleash-client.ts b/src/lib/util/offline-unleash-client.ts index ae5197bcca..70390b2e8a 100644 --- a/src/lib/util/offline-unleash-client.ts +++ b/src/lib/util/offline-unleash-client.ts @@ -19,7 +19,7 @@ export const mapFeaturesForBootstrap = ( features.map((feature) => ({ impressionData: false, ...feature, - variants: feature.variants.map((variant) => ({ + variants: (feature.variants || []).map((variant) => ({ overrides: [], ...variant, payload: variant.payload && {