mirror of
https://github.com/usememos/memos.git
synced 2025-10-18 10:16:00 +08:00
chore: remove unused nil checks
This commit is contained in:
parent
f28b654057
commit
d31d9eb71c
1 changed files with 3 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue