From 24ab8880ccd27cf1fd948fef6d7be5650ef56906 Mon Sep 17 00:00:00 2001 From: DacongDA Date: Fri, 21 Feb 2025 23:43:30 +0800 Subject: [PATCH] feat: fix bug that organization might be nil in some case and cause nil point error (#3608) --- routers/theme_filter.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/routers/theme_filter.go b/routers/theme_filter.go index 61e5eafe..7c695927 100644 --- a/routers/theme_filter.go +++ b/routers/theme_filter.go @@ -106,11 +106,14 @@ func getOrganizationThemeCookieFromUrlPath(ctx *context.Context, urlPath string) } organizationThemeCookie := &OrganizationThemeCookie{ - application.ThemeData, - application.Logo, - application.FooterHtml, - organization.Favicon, - organization.DisplayName, + ThemeData: application.ThemeData, + LogoUrl: application.Logo, + FooterHtml: application.FooterHtml, + } + + if organization != nil { + organizationThemeCookie.Favicon = organization.Favicon + organizationThemeCookie.DisplayName = organization.DisplayName } return organizationThemeCookie, nil