From cee198e036a46ae418336ba7213286168adae5f5 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Thu, 14 Mar 2019 17:15:41 +0800 Subject: [PATCH] fix: handle submodule which has no url or path --- src/driver/core/FileExplorer.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/driver/core/FileExplorer.ts b/src/driver/core/FileExplorer.ts index 8ec537d..4a48357 100644 --- a/src/driver/core/FileExplorer.ts +++ b/src/driver/core/FileExplorer.ts @@ -86,8 +86,8 @@ type Parsed = { } type ParsedModule = { - path: string - url: string + path?: string + url?: string } function resolveGitModules(root: TreeNode, blobData: BlobData) { @@ -102,6 +102,7 @@ function resolveGitModules(root: TreeNode, blobData: BlobData) { function handleParsed(root: TreeNode, parsed: Parsed) { Object.values(parsed).forEach(value => { + if (typeof value === 'string') return const { url, path } = value if (typeof url === 'string' && typeof path === 'string') { const node = findNode(root, path.split('/'))