Skip to content

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

:art: Backlink count at the doc block title including sub-blocks https://github.com/siyuan-note/siyuan/issues/13791

Danield1020e3729b7
diff --git a/kernel/api/av.go b/kernel/api/av.go
index 66de4cbf75..7be4b50d1a 100644
--- a/kernel/api/av.go
+++ b/kernel/api/av.go
@@ -77,6 +77,9 @@ func getMirrorDatabaseBlocks(c *gin.Context) {
for _, blockID := range blockIDs {
retRefDefs = append(retRefDefs, model.RefDefs{RefID: blockID, DefIDs: []string{}})
}
+ if 1 > len(retRefDefs) {
+ retRefDefs = []model.RefDefs{}
+ }
ret.Data = map[string]any{
"refDefs": retRefDefs,
diff --git a/kernel/api/block.go b/kernel/api/block.go
index 2e93286119..e0f776a54a 100644
--- a/kernel/api/block.go
+++ b/kernel/api/block.go
@@ -460,6 +460,9 @@ func getRefIDsByFileAnnotationID(c *gin.Context) {
for _, blockID := range refIDs {
retRefDefs = append(retRefDefs, model.RefDefs{RefID: blockID, DefIDs: []string{}})
}
+ if 1 > len(retRefDefs) {
+ retRefDefs = []model.RefDefs{}
+ }
ret.Data = map[string]any{
"refDefs": retRefDefs,
@@ -487,6 +490,9 @@ func getBlockDefIDsByRefText(c *gin.Context) {
for _, id := range ids {
retRefDefs = append(retRefDefs, model.RefDefs{RefID: id, DefIDs: []string{}})
}
+ if 1 > len(retRefDefs) {
+ retRefDefs = []model.RefDefs{}
+ }
ret.Data = map[string]any{
"refDefs": retRefDefs,