From c75cf8fb04263621c4359eb4e3dd0bc4f608f3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kemal=20Karako=C3=A7?= <42945832+KemalKrKX@users.noreply.github.com> Date: Fri, 6 Dec 2024 00:54:28 +0100 Subject: [PATCH] Update courses.go --- api/courses.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/courses.go b/api/courses.go index 6fb849f09..108ea0b53 100644 --- a/api/courses.go +++ b/api/courses.go @@ -290,8 +290,8 @@ func (r coursesRoutes) getPinned(c *gin.Context) { var err error // todo: check if user is allowed to see the course // -> Get full course from database - if tumLiveContext.User != nil { - enrolled, err = r.CoursesDao.IsUserEnrolledInCourse(tumLiveContext.User.ID, course.ID) + if user != nil { + enrolled, err = r.CoursesDao.IsUserEnrolledInCourse(user.ID, course.ID) if err != nil { enrolled = false }