fixed: app crash caused by detecting hosts with alternative IPs

This commit is contained in:
TrueZhuanjia committed 2026-01-09 10:48:24 +08:00
1 parent 4a59af7c20
commit e29e5bd650
1 file changed
+7 -6
+7 -6
View File
@@ -46,16 +46,17 @@ static const float POLL_RATE = 2.0f; // Poll every 2 seconds
if (_host.localAddress != nil) { if (_host.localAddress != nil) {
[array addObject:_host.localAddress]; [array addObject:_host.localAddress];
} }
if(_host.activeAddressPool.count>0){
for(NSString* address in _host.activeAddressPool){ NSArray *poolSnapshot = [_host.activeAddressPool copy];
if([address containsString:@":"]) break; for (NSString *address in poolSnapshot) {
if ([address containsString:@":"]) break;
[array addObject:address]; [array addObject:address];
} }
for(NSString* address in _host.activeAddressPool){ for (NSString *address in poolSnapshot) {
if(![address containsString:@":"]) break; if (![address containsString:@":"]) break;
[array addObject:address]; [array addObject:address];
} }
}
if (_host.address != nil) { if (_host.address != nil) {
[array addObject:_host.address]; [array addObject:_host.address];
} }