mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🐛 Reset recent-doc.json on unmarshal failure (#16251)
This commit is contained in:
parent
ff0bcce914
commit
d76c63a456
1 changed files with 4 additions and 0 deletions
|
|
@ -232,6 +232,10 @@ func getRecentDocs(sortBy string) (ret []*RecentDoc, err error) {
|
|||
|
||||
if err = gulu.JSON.UnmarshalJSON(data, &tmp); err != nil {
|
||||
logging.LogErrorf("unmarshal storage [recent-doc] failed: %s", err)
|
||||
if err = setRecentDocs([]*RecentDoc{}); err != nil {
|
||||
logging.LogErrorf("reset storage [recent-doc] failed: %s", err)
|
||||
}
|
||||
ret = []*RecentDoc{}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue