Skip to content

Commit

Permalink
Fix panic: runtime error: index out of range in tui mode future-archi…
Browse files Browse the repository at this point in the history
  • Loading branch information
kotakanbe committed Apr 6, 2016
1 parent 110d74a commit 76ade4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions report/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ func summaryLines(data models.ScanResult) string {
}
stable.AddRow(icols...)
}
// ignore UnknownCves
return fmt.Sprintf("%s", stable)
}

Expand All @@ -625,7 +624,6 @@ func setDetailLayout(g *gocui.Gui) error {
// currentScanResult.KnownCves[currentCveInfo],
// currentScanResult.Family)

//TODO error handling
text, err := detailLines()
if err != nil {
return err
Expand Down Expand Up @@ -654,6 +652,10 @@ type dataForTmpl struct {
}

func detailLines() (string, error) {
if len(currentScanResult.KnownCves) == 0 {
return "No vulnerable packages", nil
}

cveInfo := currentScanResult.KnownCves[currentCveInfo]
cveID := cveInfo.CveDetail.CveID

Expand Down

0 comments on commit 76ade4c

Please sign in to comment.