Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Unable to open the doc when the block pointed by the scroll position does not exist Fix https://github.com/siyuan-note/siyuan/issues/9030

Danielc00270cf01e4
diff --git a/kernel/model/file.go b/kernel/model/file.go
index 2962d5e033..7d30f91792 100644
--- a/kernel/model/file.go
+++ b/kernel/model/file.go
@@ -516,8 +516,12 @@ func GetDoc(startID, endID, id string, index int, query string, queryTypes map[s
luteEngine := NewLute()
node := treenode.GetNodeInTree(tree, id)
if nil == node {
- err = ErrBlockNotFound
- return
+ // Unable to open the doc when the block pointed by the scroll position does not exist https://github.com/siyuan-note/siyuan/issues/9030
+ node = treenode.GetNodeInTree(tree, tree.Root.ID)
+ if nil == node {
+ err = ErrBlockNotFound
+ return
+ }
}
if isBacklink { // 引用计数浮窗请求,需要按照反链逻辑组装 https://github.com/siyuan-note/siyuan/issues/6853