From 9e24a76810dfb2ea0683d414b01eed14e6bd8fd0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 19 Aug 2021 12:52:13 +0100 Subject: [PATCH] Ensure client preview indicator doesn't crash when encountering incorrect node types --- packages/client/src/components/preview/IndicatorSet.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/preview/IndicatorSet.svelte b/packages/client/src/components/preview/IndicatorSet.svelte index 74c9f06f0d..3151a8bd75 100644 --- a/packages/client/src/components/preview/IndicatorSet.svelte +++ b/packages/client/src/components/preview/IndicatorSet.svelte @@ -61,7 +61,7 @@ // Sanity limit of 100 active indicators const children = Array.from(parents) .map(parent => parent?.childNodes?.[0]) - .filter(child => child != null) + .filter(node => node?.nodeType === 1) .slice(0, 100) // If there aren't any nodes then reset