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.

chore: fix setting nil checks

Stevenf28b65405706
diff --git a/api/v2/memo_service.go b/api/v2/memo_service.go
index fa190a4e1..63122a495 100644
--- a/api/v2/memo_service.go
+++ b/api/v2/memo_service.go
@@ -590,6 +590,10 @@ func (s *APIV2Service) getMemoDisplayWithUpdatedTsSettingValue(ctx context.Conte
if err != nil {
return false, errors.Wrap(err, "failed to find system setting")
}
+ if memoDisplayWithUpdatedTsSetting == nil {
+ return false, nil
+ }
+
memoDisplayWithUpdatedTs := false
if memoDisplayWithUpdatedTsSetting != nil {
err = json.Unmarshal([]byte(memoDisplayWithUpdatedTsSetting.Value), &memoDisplayWithUpdatedTs)
@@ -607,6 +611,10 @@ func (s *APIV2Service) getDisablePublicMemosSystemSettingValue(ctx context.Conte
if err != nil {
return false, errors.Wrap(err, "failed to find system setting")
}
+ if disablePublicMemosSystemSetting == nil {
+ return false, nil
+ }
+
disablePublicMemos := false
err = json.Unmarshal([]byte(disablePublicMemosSystemSetting.Value), &disablePublicMemos)
if err != nil {