From bccf7c40063d3b3c4eead781d31c0edd2a280afe Mon Sep 17 00:00:00 2001 From: Dawood Khan Date: Tue, 2 Aug 2022 00:39:58 +0100 Subject: [PATCH] fixes tab plot issue (#1925) --- ui/packages/plot/src/Plot.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/packages/plot/src/Plot.svelte b/ui/packages/plot/src/Plot.svelte index 88ca23b56b..b3e4167122 100644 --- a/ui/packages/plot/src/Plot.svelte +++ b/ui/packages/plot/src/Plot.svelte @@ -84,8 +84,10 @@ }); onDestroy(() => { - document.removeChild(main_script); - plugin_scripts.forEach((child) => document.removeChild(child)); + if (main_script in document.children) { + document.removeChild(main_script); + plugin_scripts.forEach((child) => document.removeChild(child)); + } });