diff --git a/app/proxyman/config.go b/app/proxyman/config.go index 302d208f..16506627 100644 --- a/app/proxyman/config.go +++ b/app/proxyman/config.go @@ -53,6 +53,10 @@ type SniffingMatcher struct { func NewSniffingMatcher(sc *SniffingConfig) (*SniffingMatcher, error) { m := new(SniffingMatcher) + if sc == nil { + return m, nil + } + if sc.DomainsExcluded != nil { exDomain, err := domain.NewDomainMatcher(sc.DomainsExcluded) if err != nil { diff --git a/app/router/condition_test.go b/app/router/condition_test.go index 2ee1c020..e4f20341 100644 --- a/app/router/condition_test.go +++ b/app/router/condition_test.go @@ -359,7 +359,7 @@ func TestChinaSites(t *testing.T) { domains, err := loadGeoSite("CN") common.Must(err) - matcher, err := NewDomainMatcher(domains) + matcher, err := domain.NewDomainMatcher(domains) common.Must(err) type TestCase struct {