File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
packages/gatsby-theme/src/components/templates Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Sidebar, TabletSidebar } from '../TutorialSidebar';
7
7
import { TutorialMdxQuery } from 'src/graphqlTypes' ;
8
8
import { HideOnTablet , ShowOnTablet } from '../../utils/responsive' ;
9
9
import { Flex , Box } from '../shared/base' ;
10
+ import { optionalChaining } from 'src/utils/helpers' ;
10
11
11
12
type TutorialLayoutProps = { data : TutorialMdxQuery } & RouterProps ;
12
13
@@ -18,7 +19,7 @@ const TutorialLayout: React.FunctionComponent<TutorialLayoutProps> = ({
18
19
return null ;
19
20
}
20
21
const { pageTitle } = data ! . mdx ! . frontmatter ! ;
21
- const { tutorialTitle } = data ! . tutorialTitle ! . frontmatter ! ;
22
+ const tutorialTitle = optionalChaining ( ( ) => data ! . tutorialTitle ! . frontmatter ! . tutorialTitle ! ) ;
22
23
const chapters = data ! . pageTitles ! . edges ! . map (
23
24
a => a . node ! . frontmatter ! . pageTitle ! ,
24
25
) ;
You can’t perform that action at this time.
0 commit comments