diff --git a/src/client/util/courses.ts b/src/client/util/courses.ts index ad1f2de6..c3f10706 100644 --- a/src/client/util/courses.ts +++ b/src/client/util/courses.ts @@ -16,11 +16,12 @@ export const otherCourse = { } export const getCourseName = (course: Course, language: keyof Locales) => { + console.log(course) const name = - course.name[language as keyof Locales].length > - course.nameSpecifier[language as keyof Locales].length - ? course.name - : course.nameSpecifier + course.name[language as keyof Locales]?.length > + course.nameSpecifier[language as keyof Locales]?.length + ? course?.name + : course?.nameSpecifier return name }