add nil check

This commit is contained in:
Craig Peterson 2017-10-13 11:08:17 -04:00
parent 425f61142f
commit 3a969bc075

View file

@ -247,7 +247,7 @@ func (p *parser) doImport() error {
var importedTokens []Token
// first check macros. That is a simple, non-recursive replacement
if p.definedMacros[importPattern] != nil {
if p.definedMacros != nil && p.definedMacros[importPattern] != nil {
importedTokens = p.definedMacros[importPattern]
} else {
// make path relative to Caddyfile rather than current working directory (issue #867)