diff --git a/api/courses.go b/api/courses.go index 68c2bd24d..9dc38251c 100644 --- a/api/courses.go +++ b/api/courses.go @@ -288,10 +288,12 @@ func (r coursesRoutes) getPinned(c *gin.Context) { for _, course := range pinnedCourses { // todo: check if user is allowed to see the course // -> Get full course from database - //enrolled, err := r.CoursesDao.IsUserEnrolledInCourse(tumLiveContext.User.ID, course.ID) - //if err != nil { - //enrolled = false - //} + if tumLiveContext.User != nil { + enrolled, err := r.CoursesDao.IsUserEnrolledInCourse(tumLiveContext.User.ID, course.ID) + if err != nil { + enrolled = false + } + } if course.Visibility == "enrolled" && !enrolled { continue }