From 48548de9be6b8d9b269fb2c8dccf5ea8ee65c0f1 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 9 Jan 2023 15:53:57 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E8=87=AA=E5=8A=A8=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E7=B4=A2=E5=BC=95=20https://github.?= =?UTF-8?q?com/siyuan-note/siyuan/issues/7016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/transaction.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go index 92dc9be46..4992a1b41 100644 --- a/kernel/model/transaction.go +++ b/kernel/model/transaction.go @@ -20,6 +20,7 @@ import ( "bytes" "errors" "fmt" + "os" "path" "path/filepath" "strings" @@ -1295,6 +1296,10 @@ func reindexTree(rootID string, i, size int) { tree, err := LoadTree(root.BoxID, root.Path) if nil != err { + if os.IsNotExist(err) { + // 文件系统上没有找到该 .sy 文件,则订正块树 + treenode.RemoveBlockTreesByRootID(rootID) + } return }