home: fix blocked services

This commit is contained in:
Stanislav Chzhen 2024-06-10 13:27:22 +03:00
parent 1085d59a65
commit 46f793b259
1 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import (
"github.com/AdguardTeam/AdGuardHome/internal/dnsforward"
"github.com/AdguardTeam/AdGuardHome/internal/filtering"
"github.com/AdguardTeam/AdGuardHome/internal/querylog"
"github.com/AdguardTeam/AdGuardHome/internal/schedule"
"github.com/AdguardTeam/AdGuardHome/internal/whois"
"github.com/AdguardTeam/dnsproxy/proxy"
"github.com/AdguardTeam/dnsproxy/upstream"
@ -261,6 +262,12 @@ func (o *clientObject) toPersistent(
}
}
if o.BlockedServices == nil {
o.BlockedServices = &filtering.BlockedServices{
Schedule: &schedule.Weekly{},
}
}
err = o.BlockedServices.Validate()
if err != nil {
return nil, fmt.Errorf("init blocked services %q: %w", cli.Name, err)