From 58c7ff3d2fe288b68fdb5121af8cbb5c63f74c94 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 6 Apr 2018 20:18:15 +0200 Subject: [PATCH] We may not have a schedule for every rule --- dnscrypt-proxy/plugin_block_name.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dnscrypt-proxy/plugin_block_name.go b/dnscrypt-proxy/plugin_block_name.go index 2d2bd4a8..1deb4633 100644 --- a/dnscrypt-proxy/plugin_block_name.go +++ b/dnscrypt-proxy/plugin_block_name.go @@ -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