From ea1329f73e516546dab7193425e1e7dfdd232eb6 Mon Sep 17 00:00:00 2001 From: Yiming Zhang Date: Sat, 21 Dec 2024 04:07:58 -0500 Subject: [PATCH] fix: add optional chaining to prevent errors when accessing visionModels --- app/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils.ts b/app/utils.ts index f49f1a466..962e68a10 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -255,7 +255,7 @@ export function getMessageImages(message: RequestMessage): string[] { export function isVisionModel(model: string) { const clientConfig = getClientConfig(); - const envVisionModels = clientConfig.visionModels + const envVisionModels = clientConfig?.visionModels ?.split(",") .map((m) => m.trim()); if (envVisionModels?.includes(model)) {