mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-31 05:48:49 +01:00
🐛 The updateBlock API encountered a null pointer error https://github.com/siyuan-note/siyuan/issues/16705
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
da1656b083
commit
89dc302694
1 changed files with 8 additions and 1 deletions
|
|
@ -25,6 +25,7 @@ import (
|
|||
"github.com/88250/lute/ast"
|
||||
"github.com/88250/lute/parse"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
|
|
@ -701,7 +702,13 @@ func updateBlock(c *gin.Context) {
|
|||
tree.Root.FirstChild.Unlink() // 删除列表
|
||||
tree.Root.FirstChild.Unlink() // 继续删除列表 IAL
|
||||
}
|
||||
tree.Root.FirstChild.SetIALAttr("id", id)
|
||||
|
||||
if nil != tree.Root.FirstChild {
|
||||
tree.Root.FirstChild.SetIALAttr("id", id)
|
||||
} else {
|
||||
logging.LogWarnf("tree root has no child node when updating block [id=%s]", id)
|
||||
return
|
||||
}
|
||||
|
||||
data = luteEngine.Tree2BlockDOM(tree, luteEngine.RenderOptions, luteEngine.ParseOptions)
|
||||
transactions = []*model.Transaction{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue