From 30d1472c7cd1528ffafbb7c52ed049e373758aa3 Mon Sep 17 00:00:00 2001 From: Melloware Date: Fri, 10 Nov 2023 08:44:38 -0500 Subject: [PATCH] Fix #5276: Splitter prevent error on state storage (#5277) --- components/lib/splitter/Splitter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/lib/splitter/Splitter.js b/components/lib/splitter/Splitter.js index 358e4c2474..cc2bfb7a08 100644 --- a/components/lib/splitter/Splitter.js +++ b/components/lib/splitter/Splitter.js @@ -118,7 +118,9 @@ export const Splitter = React.memo( }, [props.stateStorage]); const saveState = (sizes) => { - getStorage().setItem(props.stateKey, JSON.stringify(sizes)); + if (ObjectUtils.isArray(sizes)) { + getStorage().setItem(props.stateKey, JSON.stringify(sizes)); + } }; const restoreState = React.useCallback(() => {