Explorar o código

:bug: 图标全部消失 https://github.com/siyuan-note/siyuan/issues/6974

Liang Ding %!s(int64=2) %!d(string=hai) anos
pai
achega
c957dfc6b2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      kernel/model/storage.go

+ 1 - 1
kernel/model/storage.go

@@ -342,6 +342,7 @@ func setLocalStorage(val interface{}) (err error) {
 }
 }
 
 
 func getLocalStorage() (ret map[string]interface{}, err error) {
 func getLocalStorage() (ret map[string]interface{}, err error) {
+	ret = map[string]interface{}{}
 	lsPath := filepath.Join(util.DataDir, "storage/local.json")
 	lsPath := filepath.Join(util.DataDir, "storage/local.json")
 	if !gulu.File.IsExist(lsPath) {
 	if !gulu.File.IsExist(lsPath) {
 		return
 		return
@@ -353,7 +354,6 @@ func getLocalStorage() (ret map[string]interface{}, err error) {
 		return
 		return
 	}
 	}
 
 
-	ret = map[string]interface{}{}
 	if err = gulu.JSON.UnmarshalJSON(data, &ret); nil != err {
 	if err = gulu.JSON.UnmarshalJSON(data, &ret); nil != err {
 		logging.LogErrorf("unmarshal storage [local] failed: %s", err)
 		logging.LogErrorf("unmarshal storage [local] failed: %s", err)
 		return
 		return