Skip to content

Commit 6a9e08b

Browse files
committed
Safe navigation for CodeBlock codeLanguages prop in layout
Former-commit-id: 94b2894
1 parent f8c3129 commit 6a9e08b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/layout.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ const Layout = ({
5959
</div>
6060
),
6161
pre: (props) => (
62-
<CodeBlock {...props} codeLanguages={katacodaPanelData.codelanguages} />
62+
<CodeBlock
63+
{...props}
64+
codeLanguages={katacodaPanelData?.codelanguages}
65+
/>
6366
),
6467
h2: (props) => <h2 {...props} className="mt-5" />, // eslint-disable-line jsx-a11y/heading-has-content
6568
h3: (props) => <h3 {...props} className="mt-4-5" />, // eslint-disable-line jsx-a11y/heading-has-content

0 commit comments

Comments
 (0)