@@ -308,13 +308,13 @@ const useApplicationRowsDV = (applicationsList, namespace): DataViewTr[] => {
308308 const rows : DataViewTr [ ] = [ ] ;
309309 applicationsList . forEach ( ( app , index ) => {
310310 let sources : ApplicationSource [ ] ;
311- let revisions : string [ ] ;
311+ let revisions : string [ ] = [ ] ;
312312 if ( app . spec ?. source ) {
313313 sources = [ app . spec ?. source ] ;
314314 revisions = [ app . status ?. sync ?. revision ] ;
315315 } else if ( app . spec ?. sources ) {
316- sources = app . spec . sources ;
317- revisions = app . status ?. sync ?. revisions ;
316+ sources = app . spec . sources || [ ] ;
317+ revisions = app . status ?. sync ?. revisions || [ ] ;
318318 } else {
319319 //Should never fall here since there always has to be a source or sources
320320 sources = [ ] ;
@@ -371,11 +371,11 @@ const useApplicationRowsDV = (applicationsList, namespace): DataViewTr[] => {
371371 id : app ?. status ?. sync ?. revision ,
372372 cell : (
373373 < >
374- { sources [ 0 ] . targetRevision ? sources [ 0 ] . targetRevision : 'HEAD' }
374+ { sources [ 0 ] ? .targetRevision ? sources [ 0 ] . targetRevision : 'HEAD' }
375375 { ! ( app . status ?. sourceType == 'Helm' && sources [ 0 ] . chart ) && (
376376 < RevisionFragment
377377 revision = { revisions [ 0 ] || '' }
378- repoURL = { sources [ 0 ] . repoURL }
378+ repoURL = { sources [ 0 ] ? .repoURL || '' }
379379 helm = { app . status ?. sourceType == 'Helm' && sources [ 0 ] . chart ? true : false }
380380 revisionExtra = { revisions . length > 1 && ' and ' + ( revisions . length - 1 ) + ' more' }
381381 />
0 commit comments