From 483b79bcf1b83080eeca06fb2db6bebe51fb9de5 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 27 Mar 2023 15:14:30 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=20Windows=20?= =?UTF-8?q?=E7=AB=AF=E7=AC=AC=E4=B8=89=E6=96=B9=E5=90=8C=E6=AD=A5=E7=9B=98?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=20https://github.com/siyuan-note/siyuan/issu?= =?UTF-8?q?es/7777?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/util/runtime.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/util/runtime.go b/kernel/util/runtime.go index 358c256d2..e15ccda3b 100644 --- a/kernel/util/runtime.go +++ b/kernel/util/runtime.go @@ -294,6 +294,10 @@ func existAvailabilityStatus(workspaceAbsPath string) bool { return false } + if !gulu.File.IsExist(workspaceAbsPath) { + return false + } + // 改进 Windows 端第三方同步盘检测 https://github.com/siyuan-note/siyuan/issues/7777 defer logging.Recover() @@ -303,6 +307,11 @@ func existAvailabilityStatus(workspaceAbsPath string) bool { dataAbsPath := filepath.Join(workspaceAbsPath, "data") dir, file := filepath.Split(dataAbsPath) + if !gulu.File.IsExist(dataAbsPath) { + dataAbsPath = workspaceAbsPath + return false + } + unknown, err := oleutil.CreateObject("Shell.Application") if nil != err { logging.LogWarnf("create shell application failed: %s", err)