From dcdfa59db43ae4e864e5cb1ca04b6804cca64d2f Mon Sep 17 00:00:00 2001 From: Yang Jun Date: Sun, 4 May 2025 12:40:25 +0800 Subject: [PATCH] fix: undefined in title --- core/config/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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})`; }