diff --git a/core/config/util.ts b/core/config/util.ts index 9460986bb..cc187fc55 100644 --- a/core/config/util.ts +++ b/core/config/util.ts @@ -38,7 +38,7 @@ export function addModel( (prev, curr) => (curr.title.startsWith(model.title) ? prev + 1 : prev), 0, ); - if (numMatches !== 0) { + if (numMatches !== undefined && numMatches > 0) { model.title = `${model.title} (${numMatches})`; } @@ -63,7 +63,7 @@ export function addModel( "name" in curr && curr.name.startsWith(model.title) ? prev + 1 : prev, 0, ); - if (numMatches !== 0) { + if (numMatches !== undefined && numMatches > 0) { model.title = `${model.title} (${numMatches})`; }