File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ class Pkg extends Component {
100
100
pkgDownloads,
101
101
} = this . props ;
102
102
103
- if ( ! pkgDownloads ) {
103
+ if ( ! pkgDownloads || ! pkgDownloads . response ) {
104
104
return null ;
105
105
}
106
106
@@ -130,6 +130,10 @@ class Pkg extends Component {
130
130
pkg,
131
131
} = this . props ;
132
132
133
+ if ( ! pkg || ! pkg . keywords ) {
134
+ return null ;
135
+ }
136
+
133
137
return pkg . keywords . map ( keyword => (
134
138
< Link route = { `/keyword/${ keyword } ` } key = { `package-keywords-${ pkg . name } -${ keyword } ` } >
135
139
< a > { keyword } </ a >
@@ -142,6 +146,10 @@ class Pkg extends Component {
142
146
pkg,
143
147
} = this . props ;
144
148
149
+ if ( ! pkg || ! pkg . maintainers ) {
150
+ return null ;
151
+ }
152
+
145
153
return pkg . maintainers . map ( maintainer => (
146
154
< Link route = { `/@${ maintainer . name } ` } key = { `package-maintainers-${ pkg . name } -${ maintainer . name } ` } >
147
155
< a > { maintainer . name } </ a >
@@ -161,9 +169,11 @@ class Pkg extends Component {
161
169
< div className = "header-info__basic" >
162
170
< h1 className = "header-info__name" > { pkg . name } </ h1 >
163
171
</ div >
164
- < div className = "header-info__status" >
165
- < h2 className = "header-info__version" > { `v${ pkg [ 'dist-tags' ] . latest } ` } </ h2 >
166
- </ div >
172
+ { pkg [ 'dist-tags' ] && (
173
+ < div className = "header-info__status" >
174
+ < h2 className = "header-info__version" > { `v${ pkg [ 'dist-tags' ] . latest } ` } </ h2 >
175
+ </ div >
176
+ ) }
167
177
</ HeaderInfo >
168
178
< InfoSection >
169
179
< p className = "info__desc" > { pkg . description } </ p >
You can’t perform that action at this time.
0 commit comments