File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
packages/gatsby-theme/src/pages Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -69,19 +69,25 @@ const ProfilePage: React.FunctionComponent<ProfileProps> = ({ user }) => {
6969 < button onClick = { ( ) => logoutUser ( ) } > Log out </ button >
7070 < Heading > Upvoted Tutorials </ Heading >
7171 < ul >
72- { user . upvoted . map ( a => (
73- < li key = { a . tutorial . id } >
74- < span > { a . tutorial . name } </ span >
75- </ li >
76- ) ) }
72+ { user . upvoted . map (
73+ a =>
74+ a . tutorial && (
75+ < li key = { a . tutorial . id } >
76+ < span > { a . tutorial . name } </ span >
77+ </ li >
78+ ) ,
79+ ) }
7780 </ ul >
7881 < Heading > Saved Tutorials </ Heading >
7982 < ul >
80- { user . saved . map ( a => (
81- < li key = { a . tutorial . id } >
82- < span > { a . tutorial . name } </ span >
83- </ li >
84- ) ) }
83+ { user . saved . map (
84+ a =>
85+ a . tutorial && (
86+ < li key = { a . tutorial . id } >
87+ < span > { a . tutorial . name } </ span >
88+ </ li >
89+ ) ,
90+ ) }
8591 </ ul >
8692 </ Layout >
8793 ) ;
You can’t perform that action at this time.
0 commit comments