From 40f7ca5a2f70f53214d71de4794a7568b6cc90e0 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 5 Sep 2023 10:58:20 +0200 Subject: [PATCH] Return empty array on empty project --- src/commands/Folders.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/commands/Folders.ts b/src/commands/Folders.ts index 08ba1b0d..f125ead1 100644 --- a/src/commands/Folders.ts +++ b/src/commands/Folders.ts @@ -495,6 +495,10 @@ export class Folders { public static async getContentFolders() { // Find folders that contain files const wsFolder = Folders.getWorkspaceFolder(); + if (!wsFolder) { + return []; + } + const supportedFiles = Settings.get(SETTING_CONTENT_SUPPORTED_FILETYPES) || DEFAULT_FILE_TYPES; const patterns = supportedFiles.map(