Skip to content

Commit 83e8ba9

Browse files
committed
fix: crash when language stubFs not present
1 parent 6b802c3 commit 83e8ba9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

errgoengine.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ func (e *ErrgoEngine) Analyze(workingPath, msg string) (*CompiledErrorTemplate,
3838
// initial context data extraction
3939
contextData := NewContextData(e.SharedStore, workingPath)
4040
contextData.Analyzer = template.Language.AnalyzerFactory(contextData)
41-
e.FS.AttachOrReplace(template.Language.stubFs, 1)
41+
42+
if template.Language.stubFs != nil {
43+
e.FS.AttachOrReplace(template.Language.stubFs, 1)
44+
}
4245

4346
groupNames := template.Pattern.SubexpNames()
4447
for _, submatches := range template.Pattern.FindAllStringSubmatch(msg, -1) {

0 commit comments

Comments
 (0)