Skip to content

Commit

Permalink
fix: handle zombie children (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Jul 26, 2024
1 parent 43fbf8d commit dbf8764
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react/src/context/providers/MessageProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const getMessageState = (
messageIndex: number,
) => {
const parentId = messages[messageIndex - 1]?.id ?? null;
const message = messages[messageIndex]!;
const message = messages[messageIndex];
if (!message) return null;

const isLast = getIsLast(messages, message);
const branches = getBranches(message.id);
Expand Down

0 comments on commit dbf8764

Please sign in to comment.