Skip to content

Commit 8c311ae

Browse files
authored
Merge pull request #230 from boostcampwm-2024/feature-historyState-fix
[feature-historyState-fix] history에 빈 객체가 있을 경우 접근 방지
2 parents a4b9ae0 + 99bcea0 commit 8c311ae

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)