File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
v2rayN/ServiceLib/Services/CoreConfig/Singbox Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -433,7 +433,11 @@ private void GenDnsProtectCustom()
433433 localDnsServer . tag = tag ;
434434
435435 dns4Sbox . servers . Add ( localDnsServer ) ;
436- dns4Sbox . rules . Insert ( 0 , BuildProtectDomainRule ( ) ) ;
436+ var protectDomainRule = BuildProtectDomainRule ( ) ;
437+ if ( protectDomainRule != null )
438+ {
439+ dns4Sbox . rules . Insert ( 0 , protectDomainRule ) ;
440+ }
437441
438442 _coreConfig . dns = dns4Sbox ;
439443 }
@@ -455,8 +459,12 @@ private void GenDnsProtectCustomLegacy()
455459 _coreConfig . dns ? . servers ? . Add ( localDnsServer ) ;
456460 }
457461
458- private Rule4Sbox BuildProtectDomainRule ( )
462+ private Rule4Sbox ? BuildProtectDomainRule ( )
459463 {
464+ if ( context . ProtectDomainList . Count == 0 )
465+ {
466+ return null ;
467+ }
460468 return new ( )
461469 {
462470 server = Global . SingboxLocalDNSTag ,
You can’t perform that action at this time.
0 commit comments