Skip to content

Commit

Permalink
Merge pull request #118 from dengsh12/nilpointer_fix
Browse files Browse the repository at this point in the history
Fix nil pointer panic
  • Loading branch information
dengsh12 authored Aug 2, 2024
2 parents a24726c + eaaaa89 commit e338789
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ func (p *parser) parse(parsing *Config, tokens <-chan NgxToken, ctx blockCtx, co
// if the file pattern was explicit, nginx will check
// that the included file can be opened and read
if f, err := p.openFile(pattern); err != nil {
defer f.Close()
perr := &ParseError{
What: err.Error(),
File: &parsing.File,
Expand All @@ -399,6 +398,7 @@ func (p *parser) parse(parsing *Config, tokens <-chan NgxToken, ctx blockCtx, co
return nil, perr
}
} else {
defer f.Close()
fnames = []string{pattern}
}
}
Expand Down

0 comments on commit e338789

Please sign in to comment.