Fix nil pointer panic

dev
Ice3man543 2021-06-06 15:57:22 +05:30
parent 7a962c8436
commit 31a74a3390
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ func (r *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*outpu
line := 1
for scanner.Scan() {
if strings.Contains(scanner.Text(), extraction) {
if result.FileToIndexPosition != nil {
if result.FileToIndexPosition == nil {
result.FileToIndexPosition = make(map[string]int)
}
result.FileToIndexPosition[result.Matched] = line