From 2288f7faebd0b562d884797590c6b682d7468a31 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 8 Jul 2022 09:32:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20=E5=8F=8D=E9=93=BE=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=8B=96=E6=8B=BD=E5=88=97=E8=A1=A8=E9=A1=B9=E5=88=B0?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=B8=AD=E5=BC=82=E5=B8=B8=20Fix=20https://g?= =?UTF-8?q?ithub.com/siyuan-note/siyuan/issues/5363?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/path.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/model/path.go b/kernel/model/path.go index 83447fedc..b575ab5f7 100644 --- a/kernel/model/path.go +++ b/kernel/model/path.go @@ -153,6 +153,11 @@ func toSubTree(blocks []*Block, keyword string) (ret []*Path) { if "NodeListItem" == c.Type { tree, _ := loadTreeByBlockID(c.RootID) li := treenode.GetNodeInTree(tree, c.ID) + if nil == li || nil == li.FirstChild { + // 反链面板拖拽到文档以后可能会出现这种情况 https://github.com/siyuan-note/siyuan/issues/5363 + continue + } + var first *sql.Block if 3 != li.ListData.Typ { first = sql.GetBlock(li.FirstChild.ID) @@ -250,6 +255,10 @@ func toSubTree(blocks []*Block, keyword string) (ret []*Path) { } else if "NodeHeading" == c.Type { tree, _ := loadTreeByBlockID(c.RootID) h := treenode.GetNodeInTree(tree, c.ID) + if nil == h { + continue + } + name := sql.GetBlock(h.ID).Content parentPos := 0 if "" != keyword { From 15d2e991b8889851f54bafeb1b9dbf003cebaca8 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 8 Jul 2022 09:50:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:art:=20=E9=BB=98=E8=AE=A4=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=95=B0=E6=8D=AE=E4=BB=93=E5=BA=93=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/conf/sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/conf/sync.go b/kernel/conf/sync.go index f5c58f14a..a892c4ef4 100644 --- a/kernel/conf/sync.go +++ b/kernel/conf/sync.go @@ -38,7 +38,7 @@ func NewSync() *Sync { CloudName: "main", Enabled: false, Mode: 1, - UseDataRepo: false, + UseDataRepo: true, } }