Skip to content

Commit dd95a97

Browse files
milldrclaude
andcommitted
fix: handle null category in DocCard for versioned docs
Add optional chaining to prevent TypeError when category is null in versioned docs context. The findPermalink function returns null when the permalink isn't found in global metadata for versioned docs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ba3fa2c commit dd95a97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/theme/DocCard/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function CardCategory({item}) {
9999
href={href}
100100
icon="🗃️"
101101
title={`${item.label} (${item.items.length})`}
102-
description={item.description ?? category.description ?? categoryItemsPlural(item.items.length)}
102+
description={item.description ?? category?.description ?? categoryItemsPlural(item.items.length)}
103103
/>
104104
);
105105
}

0 commit comments

Comments
 (0)