Fixes console error for the first question of a quiz

parent 4261b3e5
...@@ -139,7 +139,7 @@ export class QuizResultsComponent implements OnInit, OnDestroy, IHasTriggeredNav ...@@ -139,7 +139,7 @@ export class QuizResultsComponent implements OnInit, OnDestroy, IHasTriggeredNav
} }
public modifyVisibleQuestion(index: number): void { public modifyVisibleQuestion(index: number): void {
if (!this.quizService.quiz) { if (!this.quizService.quiz || typeof index === 'undefined' || index < 0 || index > this.quizService.quiz.questionList.length) {
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment