Skip to content

Commit d65189c

Browse files
committed
fix(check): add null check
1 parent 949d45f commit d65189c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/api/flows.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ export function useFlows() {
5555

5656
function getStepStatus(flowSlug: string, stepId: string) {
5757
// TODO: add server-side call to sync date.
58-
// Iterate through all flow responses and find the latest one for this step
59-
const responsesForStep = flowResponses.filter(
58+
const responsesForStep = flowResponses ? flowResponses.filter(
6059
(r) => r.flowSlug === flowSlug && r.stepId === stepId
61-
);
60+
)[0] : null;
6261
}
6362

6463
function getFlowData(slug: string): Flow {

0 commit comments

Comments
 (0)