Skip to content

Commit

Permalink
Fix defaultModel undefined error
Browse files Browse the repository at this point in the history
  • Loading branch information
ZTH7 authored Jul 21, 2024
1 parent 115f357 commit 2fd68bc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/utils/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit 2fd68bc

Please sign in to comment.