Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: rss link (#1534)

boojack7d6934d00c42
diff --git a/server/rss.go b/server/rss.go
index 9da775ad7..5027b680d 100644
--- a/server/rss.go
+++ b/server/rss.go
@@ -113,6 +113,13 @@ func generateRSSFromMemoList(memoList []*api.Memo, baseURL string, profile *api.
}
func getSystemCustomizedProfile(ctx context.Context, s *Server) (*api.CustomizedProfile, error) {
+ systemSetting, err := s.Store.FindSystemSetting(ctx, &api.SystemSettingFind{
+ Name: api.SystemSettingCustomizedProfileName,
+ })
+ if err != nil && common.ErrorCode(err) != common.NotFound {
+ return nil, err
+ }
+
customizedProfile := &api.CustomizedProfile{
Name: "memos",
LogoURL: "",
@@ -121,14 +128,10 @@ func getSystemCustomizedProfile(ctx context.Context, s *Server) (*api.Customized
Appearance: "system",
ExternalURL: "",
}
- systemSetting, err := s.Store.FindSystemSetting(ctx, &api.SystemSettingFind{
- Name: api.SystemSettingCustomizedProfileName,
- })
- if err != nil && common.ErrorCode(err) != common.NotFound {
- return nil, err
- }
- if err := json.Unmarshal([]byte(systemSetting.Value), customizedProfile); err != nil {
- return nil, err
+ if systemSetting != nil {
+ if err := json.Unmarshal([]byte(systemSetting.Value), customizedProfile); err != nil {
+ return nil, err
+ }
}
return customizedProfile, nil
}