Skip to content

Commit

Permalink
Fix #5276: Splitter prevent error on state storage (#5277)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Nov 10, 2023
1 parent 717317b commit 30d1472
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/lib/splitter/Splitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 30d1472

Please sign in to comment.