[Issue #652] Adding early return in -startMonitoringNetworkReachability if network reachability object could not be created (i.e. invalid hostnames)

Signed-off-by: Mattt Thompson <m@mattt.me>
This commit is contained in:
Basil Shkara 2012-11-30 14:22:05 -08:00 committed by Mattt Thompson
parent 09cf2d39e2
commit 99c58dcf08

View file

@ -317,6 +317,10 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {}
}
self.networkReachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [[self.baseURL host] UTF8String]);
if (!self.networkReachability) {
return;
}
__weak __typeof(&*self)weakSelf = self;
AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status){