From bc6b382bd16aa3e12d0e6f8fecee55f76f639c0b Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 26 Dec 2025 22:02:55 +0800 Subject: [PATCH] :bug: The `updateBlock` API encountered a null pointer error https://github.com/siyuan-note/siyuan/issues/16705 Signed-off-by: Daniel <845765@qq.com> --- kernel/api/block_op.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/api/block_op.go b/kernel/api/block_op.go index 1d58fb9af..718886a2d 100644 --- a/kernel/api/block_op.go +++ b/kernel/api/block_op.go @@ -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)