Skip to content

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

:art: Improve av https://github.com/siyuan-note/siyuan/issues/15600

Danieled4cc1faf629
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index add6a74de5..07b36a59d2 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -1275,6 +1275,10 @@ func SearchAttributeView(keyword string, excludeAvIDs []string) (ret []*AvSearch
trees := filesys.LoadTrees(blockIDs)
for _, avBlock := range avBlocks {
+ if 1 > len(avBlock.BlockIDs) {
+ continue
+ }
+
parentResult := buildSearchAttributeViewResult(avSearchTmpResults, avBlock.BlockIDs[0], trees, excludeAvIDs)
if nil == parentResult {
continue
diff --git a/kernel/treenode/av.go b/kernel/treenode/av.go
index 5bd3bebfed..1b1449e21b 100644
--- a/kernel/treenode/av.go
+++ b/kernel/treenode/av.go
@@ -90,6 +90,10 @@ func BatchGetMirrorAttrViewBlocks(avIDs []string) (ret []*AvBlock) {
for blockID := range bts {
blockIDs = append(blockIDs, blockID)
}
+ if 1 > len(blockIDs) {
+ continue
+ }
+
avBlock := &AvBlock{
AvID: avID,
BlockIDs: blockIDs,