File tree 2 files changed +4
-4
lines changed
src/app/(public)/repos/[language]
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ interface RepoCardProps {
17
17
18
18
export function RepoCard ( { repo } : RepoCardProps ) {
19
19
const truncatedDescription =
20
- repo . description . length > MAX_DESCRIPTION_LENGTH
20
+ repo . description ? .length > MAX_DESCRIPTION_LENGTH
21
21
? repo . description . substring ( 0 , MAX_DESCRIPTION_LENGTH ) + '...'
22
22
: repo . description ;
23
23
@@ -29,7 +29,7 @@ export function RepoCard({ repo }: RepoCardProps) {
29
29
} ) ;
30
30
31
31
const displayedTopics = sortedTopics . slice ( 0 , MAX_TOPICS_DISPLAY ) ;
32
- const hasMoreTopics = sortedTopics . length > MAX_TOPICS_DISPLAY ;
32
+ const hasMoreTopics = sortedTopics ? .length > MAX_TOPICS_DISPLAY ;
33
33
34
34
return (
35
35
< section className = "transition duration-300 shadow-sm card bg-hacktoberfest-black ring-1 ring-hacktoberfest-light-pink hover:scale-105 hover:shadow-2xl hover:shadow-hacktoberfest-deep-pink h-125" >
@@ -64,7 +64,7 @@ export function RepoCard({ repo }: RepoCardProps) {
64
64
65
65
< h6 className = "my-5 text-lg text-hacktoberfest-beige" >
66
66
{ emojify ( truncatedDescription ) }
67
- { repo . description . length > MAX_DESCRIPTION_LENGTH && (
67
+ { repo . description ? .length > MAX_DESCRIPTION_LENGTH && (
68
68
< a
69
69
href = { repo . html_url + '?ref=finder.usmans.me' }
70
70
target = "_blank"
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ async function getRepos(
133
133
return ! repo . archived && ! reports . find ( report => report . repoId === repo . id ) ;
134
134
} ) ;
135
135
136
- if ( ! Array . isArray ( repos . items ) || repos . items . length < 1 ) notFound ( ) ;
136
+ if ( ! Array . isArray ( repos . items ) || repos . items ? .length < 1 ) notFound ( ) ;
137
137
138
138
return {
139
139
page : + page . toString ( ) ,
You can’t perform that action at this time.
0 commit comments