Skip to content

Commit

Permalink
🩹 Fix crash on bot load when it has no groups
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Mar 9, 2023
1 parent ff04edf commit bf1fbf2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/builder/src/features/graph/components/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export const Graph = ({
} = useGraph()
const { updateGroupCoordinates } = useGroupsCoordinates()
const [graphPosition, setGraphPosition] = useState(
graphPositionDefaultValue(typebot.groups[0]?.graphCoordinates)
graphPositionDefaultValue(
typebot.groups.at(0)?.graphCoordinates ?? { x: 0, y: 0 }
)
)
const [debouncedGraphPosition] = useDebounce(graphPosition, 200)
const transform = useMemo(
Expand Down

0 comments on commit bf1fbf2

Please sign in to comment.