Skip to content

Commit

Permalink
Fix a error when no json dirs are found under results #180
Browse files Browse the repository at this point in the history
  • Loading branch information
kotakanbe committed Sep 14, 2016
1 parent ea1b5dd commit 0d77853
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions report/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ func selectScanHistory(jsonDirName string) (latest models.ScanHistory, err error
if jsonDirs, err = GetValidJSONDirs(); err != nil {
return
}
if len(jsonDirs) == 0 {
return latest, fmt.Errorf("No scan results are found in %s", config.Conf.JSONBaseDir)
}
jsonDir = jsonDirs[0]
}
if latest, err = LoadOneScanHistory(jsonDir); err != nil {
Expand Down

0 comments on commit 0d77853

Please sign in to comment.