We may not have a schedule for every rule

This commit is contained in:
Frank Denis 2018-04-06 20:18:15 +02:00
parent 105cb2c525
commit 58c7ff3d2f
1 changed files with 4 additions and 1 deletions

View File

@ -108,7 +108,10 @@ func (plugin *PluginBlockName) Eval(pluginsState *PluginsState, msg *dns.Msg) er
}
qName := strings.ToLower(StripTrailingDot(questions[0].Name))
reject, reason, xweeklyRanges := plugin.patternMatcher.Eval(qName)
weeklyRanges := xweeklyRanges.(*WeeklyRanges)
var weeklyRanges *WeeklyRanges
if xweeklyRanges != nil {
weeklyRanges = xweeklyRanges.(*WeeklyRanges)
}
if reject {
if weeklyRanges != nil && !weeklyRanges.Match() {
reject = false