From eeecc441eaae7e768ea0266153f9cf3cb6466342 Mon Sep 17 00:00:00 2001 From: melloware Date: Fri, 10 Nov 2023 08:33:46 -0500 Subject: [PATCH] Fix #5276: Splitter prevent error on state storage --- 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(() => {