From 5eae7159c7f9172008d9de0a459fb3b3a3bcde08 Mon Sep 17 00:00:00 2001 From: LuitelSamikshya Date: Mon, 18 Apr 2022 17:21:33 -0500 Subject: [PATCH] nil value check --- v2/internal/runner/runner.go | 9 +++++++-- v2/pkg/catalog/find.go | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/v2/internal/runner/runner.go b/v2/internal/runner/runner.go index 479355f8..d9090e37 100644 --- a/v2/internal/runner/runner.go +++ b/v2/internal/runner/runner.go @@ -359,9 +359,14 @@ func (r *Runner) RunEnumeration() error { var results *atomic.Bool if r.options.AutomaticScan { - results, err = r.executeSmartWorkflowInput(executerOpts, store, engine) + if results, err = r.executeSmartWorkflowInput(executerOpts, store, engine); err != nil { + return err + } + } else { - results, err = r.executeTemplatesInput(store, engine) + if results, err = r.executeTemplatesInput(store, engine); err != nil { + return err + } } if r.interactsh != nil { diff --git a/v2/pkg/catalog/find.go b/v2/pkg/catalog/find.go index 348c2841..ed5c950d 100644 --- a/v2/pkg/catalog/find.go +++ b/v2/pkg/catalog/find.go @@ -81,7 +81,7 @@ func (c *Catalog) GetTemplatePath(target string) ([]string, error) { return nil, errors.Wrap(err, "could not find directory matches") } if len(matches) == 0 { - return nil, errors.Errorf("no templates found in path") + return nil, errors.Errorf("no templates found in path %s", absPath) } return matches, nil }