From e2997c345c42a4c76b9dc6796a6c4de49d1adc78 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 20 Oct 2019 21:20:39 -0400 Subject: [PATCH] [F] Fix null case --- src/components/navigation/navigation.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/navigation/navigation.ts b/src/components/navigation/navigation.ts index e9dac2a..c14b98a 100644 --- a/src/components/navigation/navigation.ts +++ b/src/components/navigation/navigation.ts @@ -91,8 +91,14 @@ export default class Navigation extends Vue // Find current course index let courseIndex = this.courses.findIndex(c => c.id == +courseId); + // Find next course + let course = this.courses[courseIndex + indexOffset]; + + // Null case + if (course == null) return; + // Set tab to the next index - this.updateIndex(CourseUtils.formatTabIndex(this.courses[courseIndex + indexOffset])) + this.updateIndex(CourseUtils.formatTabIndex(course)) } /**