🐛 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:
Daniel 2025-12-26 22:02:55 +08:00
parent 89dc302694
commit bc6b382bd1
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -706,8 +706,8 @@ func updateBlock(c *gin.Context) {
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
logging.LogWarnf("tree root has no child node, append empty paragraph node")
tree.Root.AppendChild(treenode.NewParagraph(id))
}
data = luteEngine.Tree2BlockDOM(tree, luteEngine.RenderOptions, luteEngine.ParseOptions)