mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 12:28:48 +01:00
🐛 v202301271540 logging.go panic 异常,导致内核崩溃 Fix https://github.com/siyuan-note/siyuan/issues/7179
This commit is contained in:
parent
6235d722d1
commit
6e02ffd7f5
1 changed files with 8 additions and 1 deletions
|
|
@ -91,6 +91,9 @@ func LoadTree(boxID, p string, luteEngine *lute.Lute) (ret *parse.Tree, err erro
|
|||
}
|
||||
|
||||
ial := ReadDocIAL(parentData)
|
||||
if 1 > len(ial) {
|
||||
logging.LogWarnf("tree [%s] is corrupted", filePath)
|
||||
}
|
||||
title := ial["title"]
|
||||
if "" == title {
|
||||
title = "Untitled"
|
||||
|
|
@ -266,6 +269,10 @@ func parseJSON2Tree(boxID, p string, jsonData []byte, luteEngine *lute.Lute) (re
|
|||
|
||||
func ReadDocIAL(data []byte) (ret map[string]string) {
|
||||
ret = map[string]string{}
|
||||
jsoniter.Get(data, "Properties").ToVal(&ret)
|
||||
val := jsoniter.Get(data, "Properties")
|
||||
if nil == val {
|
||||
return
|
||||
}
|
||||
val.ToVal(&ret)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue