Skip to content

Commit 99bcea0

Browse files
committed
fix : history에 빈 객체가 포함된 경우 접근 불가능하도록 변경
1 parent a4b9ae0 commit 99bcea0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

client/src/hooks/useHistoryState.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default function useHistoryState<T>(data: string) {
2626
(setData) => {
2727
if (!history[0] || pointer <= 0) return;
2828
const parsedData = JSON.parse(history[pointer - 1]);
29+
if (Object.keys(parsedData).length === 0) return;
2930
handleSocketEvent({
3031
actionType: "updateNode",
3132
payload: parsedData,

0 commit comments

Comments
 (0)