diff --git a/report/tui.go b/report/tui.go index a1aca832ae..6804d35f77 100644 --- a/report/tui.go +++ b/report/tui.go @@ -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 {