Skip to content

Commit 24ab888

Browse files
authored
feat: fix bug that organization might be nil in some case and cause nil point error (casdoor#3608)
1 parent f26b485 commit 24ab888

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

routers/theme_filter.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ func getOrganizationThemeCookieFromUrlPath(ctx *context.Context, urlPath string)
106106
}
107107

108108
organizationThemeCookie := &OrganizationThemeCookie{
109-
application.ThemeData,
110-
application.Logo,
111-
application.FooterHtml,
112-
organization.Favicon,
113-
organization.DisplayName,
109+
ThemeData: application.ThemeData,
110+
LogoUrl: application.Logo,
111+
FooterHtml: application.FooterHtml,
112+
}
113+
114+
if organization != nil {
115+
organizationThemeCookie.Favicon = organization.Favicon
116+
organizationThemeCookie.DisplayName = organization.DisplayName
114117
}
115118

116119
return organizationThemeCookie, nil

0 commit comments

Comments
 (0)