fix: nil pointer on get userdata (#815)

This commit is contained in:
Fabi 2020-10-07 10:46:22 +02:00 committed by GitHub
parent 9ad547185c
commit a19b4d2659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {