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: remove unused nil checks

Stevend31d9eb71c8a
diff --git a/api/v2/memo_service.go b/api/v2/memo_service.go
index 63122a495..257c95534 100644
--- a/api/v2/memo_service.go
+++ b/api/v2/memo_service.go
@@ -595,11 +595,8 @@ func (s *APIV2Service) getMemoDisplayWithUpdatedTsSettingValue(ctx context.Conte
}
memoDisplayWithUpdatedTs := false
- if memoDisplayWithUpdatedTsSetting != nil {
- err = json.Unmarshal([]byte(memoDisplayWithUpdatedTsSetting.Value), &memoDisplayWithUpdatedTs)
- if err != nil {
- return false, errors.Wrap(err, "failed to unmarshal system setting value")
- }
+ if err := json.Unmarshal([]byte(memoDisplayWithUpdatedTsSetting.Value), &memoDisplayWithUpdatedTs); err != nil {
+ return false, errors.Wrap(err, "failed to unmarshal system setting value")
}
return memoDisplayWithUpdatedTs, nil
}
@@ -616,8 +613,7 @@ func (s *APIV2Service) getDisablePublicMemosSystemSettingValue(ctx context.Conte
}
disablePublicMemos := false
- err = json.Unmarshal([]byte(disablePublicMemosSystemSetting.Value), &disablePublicMemos)
- if err != nil {
+ if err := json.Unmarshal([]byte(disablePublicMemosSystemSetting.Value), &disablePublicMemos); err != nil {
return false, errors.Wrap(err, "failed to unmarshal system setting value")
}
return disablePublicMemos, nil