File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -349,14 +349,15 @@ export class SbomCollector {
349349 this . decisions [ fullName ] = ( this . decisions [ fullName ] || "" ) + ` (branch scan error: ${ ( e as Error ) . message } )` ;
350350 console . debug ( ( e as Error ) . message ) ;
351351 }
352+ }
352353
353- if ( sbom . error ) this . summary . failedCount ++ ; else this . summary . successCount ++ ;
354+ if ( ! sbom || sbom . error ) this . summary . failedCount ++ ; else this . summary . successCount ++ ;
354355
355- // Write freshly fetched SBOM immediately if a cache directory is configured
356- if ( this . opts . loadFromDir && this . opts . syncSboms && this . opts . loadFromDir . length ) {
357- try { writeOne ( sbom , { outDir : this . opts . loadFromDir } ) ; } catch { /* ignore write errors */ }
358- }
356+ // Write freshly fetched SBOM immediately if a cache directory is configured
357+ if ( sbom && ! sbom . error && this . opts . loadFromDir && this . opts . syncSboms && this . opts . loadFromDir . length ) {
358+ try { writeOne ( sbom , { outDir : this . opts . loadFromDir } ) ; } catch { /* ignore write errors */ }
359359 }
360+
360361 if ( sbom ) {
361362 newSboms . push ( sbom ) ;
362363 }
You can’t perform that action at this time.
0 commit comments