🐛 Fix NPE

This commit is contained in:
Daniel 2024-10-21 23:52:02 +08:00
parent f708e99a74
commit 0d1c62a4e4
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -96,7 +96,9 @@ func GetBackmentionDoc(defID, refTreeID, keyword string, containChildren bool) (
trees := filesys.LoadTrees(mentionBlockIDs)
for id, tree := range trees {
backlink := buildBacklink(id, tree, mentionKeywords, luteEngine)
ret = append(ret, backlink)
if nil != backlink {
ret = append(ret, backlink)
}
}
return
}
@ -133,7 +135,9 @@ func GetBacklinkDoc(defID, refTreeID, keyword string, containChildren bool) (ret
keywords = append(keywords, keyword)
}
backlink := buildBacklink(linkRef.ID, refTree, keywords, luteEngine)
ret = append(ret, backlink)
if nil != backlink {
ret = append(ret, backlink)
}
}
return
}