diff --git a/errgoengine.go b/errgoengine.go index d55448c..dc8ed4a 100644 --- a/errgoengine.go +++ b/errgoengine.go @@ -39,7 +39,10 @@ func (e *ErrgoEngine) Analyze(workingPath, msg string) (*CompiledErrorTemplate, // initial context data extraction contextData := NewContextData(e.SharedStore, workingPath) contextData.Analyzer = template.Language.AnalyzerFactory(contextData) - e.FS.FSs[1] = template.Language.stubFs + + if template.Language.stubFs != nil { + e.FS.FSs[1] = template.Language.stubFs + } groupNames := template.Pattern.SubexpNames() for _, submatches := range template.Pattern.FindAllStringSubmatch(msg, -1) { diff --git a/error_templates/test_utils/test_utils.go b/error_templates/test_utils/test_utils.go index c8e6f4e..3a3b4d7 100644 --- a/error_templates/test_utils/test_utils.go +++ b/error_templates/test_utils/test_utils.go @@ -171,7 +171,7 @@ func (cases TestCases) Execute(t *testing.T) { } t.Run(caseName, func(t *testing.T) { - cases.engine.FS = tCase.Files + cases.engine.FS.FSs[0] = tCase.Files template, data, err := cases.engine.Analyze("", tCase.Input) if err != nil { t.Fatal(err)