Skip to content

Commit b7172c6

Browse files
theletterfclaude
andcommitted
Fix IDE0370: remove unnecessary null-forgiving operators in SiteNavigationV2
The pattern `{ Page: var page }` combined with the prior `{ Page: null }` arm already guarantees `page` is non-null when this arm matches. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5c7380b commit b7172c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Elastic.Documentation.Navigation/V2/SiteNavigationV2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ string sitePrefix
6060
GroupNavV2Item group => CreateGroup(group, nodes, parent, depth, sitePrefix),
6161
TocNavV2Item toc => nodes.TryGetValue(toc.Source, out var node) ? node : null,
6262
PageNavV2Item { Page: null, Title: var title } => new PlaceholderNavigationLeaf(title ?? "Untitled", parent),
63-
PageNavV2Item { Page: var page, Title: var title } => new PageCrossLinkLeaf(page!, title ?? page!.ToString(), sitePrefix, parent),
63+
PageNavV2Item { Page: var page, Title: var title } => new PageCrossLinkLeaf(page, title ?? page.ToString(), sitePrefix, parent),
6464
_ => null
6565
};
6666

0 commit comments

Comments
 (0)