Skip to content

Commit

Permalink
Merge pull request #302 from luotianqi777/fix_dsdx
Browse files Browse the repository at this point in the history
fix: dsdx nil pointer panic
  • Loading branch information
SuperChen-CC authored Oct 11, 2024
2 parents 0e41c4a + 2d3f918 commit 21e7581
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opensca/sca/sbom/dsdx.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func ParseDsdxXml(f *model.File) *model.DepGraph {

func parseDsdxDoc(f *model.File, doc *model.DsdxDocument) *model.DepGraph {

if doc == nil {
if doc == nil || len(doc.Components) == 0 {
return nil
}

Expand Down Expand Up @@ -76,7 +76,7 @@ func parseDsdxDoc(f *model.File, doc *model.DsdxDocument) *model.DepGraph {
// ReadDsdx 读取dsdx文件
func ReadDsdx(f *model.File) *model.DsdxDocument {

dsdx := &model.DsdxDocument{}
dsdx := &model.DsdxDocument{Dependencies: model.DsdxDependencies{}}

// 记录依赖关系
dependencies := map[string][]string{}
Expand Down

0 comments on commit 21e7581

Please sign in to comment.