浏览代码

:art: https://github.com/siyuan-note/siyuan/issues/4494

Vanessa 2 年之前
父节点
当前提交
4acc006b13
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/src/util/newFile.ts

+ 1 - 1
app/src/util/newFile.ts

@@ -89,7 +89,7 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin
             }
             const id = Lute.NewNodeID();
             const newPath = pathPosix().join(getDisplayName(currentPath, false, true), id + ".sy");
-            if (paths.length > 0) {
+            if (paths) {
                 paths[paths.indexOf(undefined)] = newPath;
             }
             fetchPost("/api/filetree/createDoc", {