Add guard before checking locally installed backends

This commit is contained in:
Akarshan 2025-09-08 13:08:14 +05:30
parent 4e37c361c4
commit a6e4f28830
No known key found for this signature in database
GPG Key ID: D75C9634A870665F

View File

@ -18,6 +18,7 @@ export async function getLocalInstalledBackends(): Promise<
'llamacpp', 'llamacpp',
'backends', 'backends',
]) ])
if (await fs.existsSync(backendsDir)) {
const versionDirs = await fs.readdirSync(backendsDir) const versionDirs = await fs.readdirSync(backendsDir)
// If the folder does not exist we are done. // If the folder does not exist we are done.
@ -37,6 +38,7 @@ export async function getLocalInstalledBackends(): Promise<
} }
} }
} }
}
return local return local
} }