Skip to content

Commit bc63846

Browse files
committed
non-null assertionを削除
1 parent 9846e7e commit bc63846

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/(docs)/@chat/chat/[chatId]/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ export default async function ChatPage({
3535
const targetPage = targetLang?.pages.find(
3636
(page) => page.slug === chatData.section.pagePath.split("/")[1]
3737
);
38-
const sections = await getMarkdownSections(targetLang!.id, targetPage!.slug);
38+
const sections =
39+
targetLang && targetPage
40+
? await getMarkdownSections(targetLang.id, targetPage.slug)
41+
: [];
3942
const targetSection = sections.find((sec) => sec.id === chatData.sectionId);
4043

4144
return (

0 commit comments

Comments
 (0)