From 9aea213d45aa5e93d61af0f53d62f4782d42d442 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Mon, 23 Oct 2023 16:16:02 +0200 Subject: [PATCH] fix: avoid crash when visualization object is empty (ie. New) --- src/components/Visualization/Visualization.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Visualization/Visualization.js b/src/components/Visualization/Visualization.js index 1a7228a74c..4266c00f68 100644 --- a/src/components/Visualization/Visualization.js +++ b/src/components/Visualization/Visualization.js @@ -246,9 +246,11 @@ export const visualizationSelector = createSelector( (current, disabledOptions) => { const visualization = cloneDeep(current) - Object.keys(disabledOptions).forEach( - (option) => delete visualization[option] - ) + if (visualization) { + Object.keys(disabledOptions).forEach( + (option) => delete visualization[option] + ) + } return visualization }