Merge pull request #181 from future-architect/fix-nilpointer-no-json-dir-tui

Fix a error when no json dirs are found under results #180
This commit is contained in:
Kota Kanbe
2016-09-14 12:12:49 +09:00
committed by GitHub

View File

@@ -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 {