From b103370d2bada76246bc20cdacb46de52a27784c Mon Sep 17 00:00:00 2001 From: tdurieux Date: Fri, 12 Jan 2024 15:31:09 +0100 Subject: [PATCH] fix: protect file list download --- src/source/GitHubStream.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/source/GitHubStream.ts b/src/source/GitHubStream.ts index 7989d4c..76e9c85 100644 --- a/src/source/GitHubStream.ts +++ b/src/source/GitHubStream.ts @@ -170,7 +170,14 @@ export default class GitHubStream extends GitHubBase implements SourceBase { ); count.request++; const data = await this.getGHTree(sha, { recursive: false }); - this.tree2Tree(data.tree, truncatedTree, parentPath); + + try { + this.tree2Tree(data.tree, truncatedTree, parentPath); + } catch (error) { + console.error(error); + this.repository.model.truckedFileList = true; + return; + } count.file += data.tree.length; if (data.tree.length < 100 && count.request < 200) {