From a19b4d2659fd1c596b9411bd6aef55585ec950b0 Mon Sep 17 00:00:00 2001 From: Fabi <38692350+fgerschwiler@users.noreply.github.com> Date: Wed, 7 Oct 2020 10:46:22 +0200 Subject: [PATCH] fix: nil pointer on get userdata (#815) --- internal/ui/login/handler/renderer.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/ui/login/handler/renderer.go b/internal/ui/login/handler/renderer.go index a4c2e30b6d..197acfa51e 100644 --- a/internal/ui/login/handler/renderer.go +++ b/internal/ui/login/handler/renderer.go @@ -226,11 +226,14 @@ func (l *Login) renderInternalError(w http.ResponseWriter, r *http.Request, auth } func (l *Login) getUserData(r *http.Request, authReq *model.AuthRequest, title string, errType, errMessage string) userData { - return userData{ + userData := userData{ baseData: l.getBaseData(r, authReq, title, errType, errMessage), profileData: l.getProfileData(authReq), - Linking: len(authReq.LinkingUsers) > 0, } + if authReq != nil && authReq.LinkingUsers != nil { + userData.Linking = len(authReq.LinkingUsers) > 0 + } + return userData } func (l *Login) getBaseData(r *http.Request, authReq *model.AuthRequest, title string, errType, errMessage string) baseData {