diff --git a/src/utils/docsFinder.ts b/src/utils/docsFinder.ts index 7c71a413..5ffe9a8f 100644 --- a/src/utils/docsFinder.ts +++ b/src/utils/docsFinder.ts @@ -17,6 +17,9 @@ export async function findDocumentation( | 'builtin_doc_fragment' | 'collection_doc_fragment' ): Promise { + if (!fs.existsSync(dir) || fs.lstatSync(dir).isFile()) { + return []; + } let files; switch (kind) { case 'builtin': @@ -74,6 +77,9 @@ export async function findPluginRouting( kind: 'builtin' | 'collection' ): Promise { const pluginRouting = new Map(); + if (!fs.existsSync(dir) || fs.lstatSync(dir).isFile()) { + return pluginRouting; + } let files; switch (kind) { case 'builtin':