Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 98fd773

Browse files
committed
use default dns if no records in preferences
1 parent 0d89ae9 commit 98fd773

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

V2RayX/ServerProfile.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ - (NSDictionary*)v2rayConfigWithLocalPort:(NSInteger)localPort
6060
if ([self.useMkcp boolValue] == true) {
6161
config[@"outbound"][@"streamSettings"] = @{@"network": @"kcp"};
6262
}
63-
config[@"dns"][@"servers"] = [[[NSUserDefaults standardUserDefaults] objectForKey:@"dns"] componentsSeparatedByString:@","];
63+
NSArray* dnsArray = [[[NSUserDefaults standardUserDefaults] objectForKey:@"dns"] componentsSeparatedByString:@","];
64+
if ([dnsArray count] > 0) {
65+
config[@"dns"][@"servers"] = dnsArray;
66+
}
6467
return config;
6568
}
6669

0 commit comments

Comments
 (0)