diff --git a/app/utils/model.ts b/app/utils/model.ts index 55a5ee0d67d..dc4b1f55cc7 100644 --- a/app/utils/model.ts +++ b/app/utils/model.ts @@ -98,10 +98,9 @@ export function collectModelTableWithDefaultModel( defaultModel: string, ) { let modelTable = collectModelTable(models, customModels); - if (defaultModel && defaultModel !== "") { + if (defaultModel && defaultModel !== "" && defaultModel in modelTable) { modelTable[defaultModel] = { ...modelTable[defaultModel], - name: defaultModel, available: true, isDefault: true, };