diff --git a/server/lib/requests/instances-index.ts b/server/lib/requests/instances-index.ts index 210a0e7..6fc58bf 100644 --- a/server/lib/requests/instances-index.ts +++ b/server/lib/requests/instances-index.ts @@ -15,13 +15,17 @@ export async function listIndexInstancesHost (): Promise { } export async function getMajorInstanceVersion (host: string): Promise { - const { body } = await doRequest({ uri: `https://${host}/api/v1/config`, json: true }) + try { + const { body } = await doRequest({ uri: `https://${host}/api/v1/config`, json: true }) - const version = body.serverVersion + const version = body.serverVersion - const majorVersion = parseInt(version.split('.')[0]) + const majorVersion = parseInt(version.split('.')[0]) - return isNaN(majorVersion) - ? 0 - : majorVersion + return isNaN(majorVersion) + ? 0 + : majorVersion + } catch { + return 0 + } }