Skip to content

Commit 0978dc6

Browse files
committed
fix(backend): use nullish coalescing for repository info defaults
1 parent 6ab033b commit 0978dc6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

services/backend/src/services/mcpCatalogService.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,13 @@ export class McpCatalogService {
399399
try {
400400
const repoInfo = await GitHubService.getRepositoryInfo(data.repository_url, this.logger);
401401
githubInfo = {
402-
description: data.description || repoInfo.description,
403-
long_description: data.long_description || repoInfo.description,
404-
language: data.language || repoInfo.language,
405-
website_url: data.website_url || repoInfo.homepage,
406-
license: data.license || repoInfo.license,
407-
tags: data.tags || repoInfo.topics,
408-
github_account_id: data.github_account_id || repoInfo.github_account_id
402+
description: data.description ?? repoInfo.description,
403+
long_description: data.long_description ?? repoInfo.description,
404+
language: data.language ?? repoInfo.language,
405+
website_url: data.website_url ?? repoInfo.homepage,
406+
license: data.license ?? repoInfo.license,
407+
tags: data.tags ?? repoInfo.topics,
408+
github_account_id: data.github_account_id ?? repoInfo.github_account_id
409409
};
410410

411411
this.logger.info({
@@ -429,8 +429,8 @@ export class McpCatalogService {
429429
id: serverId,
430430
name: data.name,
431431
slug,
432-
description: githubInfo.description || data.description,
433-
long_description: githubInfo.long_description || data.long_description,
432+
description: githubInfo.description ?? data.description,
433+
long_description: githubInfo.long_description ?? data.long_description,
434434

435435
// Version information
436436
version: data.version || null,

0 commit comments

Comments
 (0)