Skip to content

Commit 59a5f53

Browse files
authored
Update QuizForm.tsx
Error handling for empty questionSet
1 parent f9bef50 commit 59a5f53

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/QuizForm.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ const QuizForm: FC<Props> = ({
5454
};
5555

5656
if (isLoading) return <p>Loading...</p>;
57+
//Error Handling for loading issues
58+
if (!questionSet) return <p>Loading questions failed</p>;
59+
5760
const { question, options, images } = questionSet!;
5861
const watchInput = watch(`options.${currentQuestionIndex}`);
5962

0 commit comments

Comments
 (0)