From 71e159bd6484d941ab4baa9639009bf0d9265c6c Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Wed, 18 Sep 2024 17:24:53 +0200 Subject: [PATCH] fix: branches folder doesnt exist error --- packages/app/server/api/branches/index.get.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/app/server/api/branches/index.get.ts b/packages/app/server/api/branches/index.get.ts index bf190d6..8f61661 100644 --- a/packages/app/server/api/branches/index.get.ts +++ b/packages/app/server/api/branches/index.get.ts @@ -4,5 +4,8 @@ import { getLocalDbFolder, resourceInstancesFolders } from '@moquerie/core' export default defineEventHandler(async () => { const folder = path.join(getLocalDbFolder(getMq()), ...resourceInstancesFolders) + if (!fs.existsSync(folder)) { + return [] + } return fs.promises.readdir(folder) })