[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:
parent
09cf2d39e2
commit
99c58dcf08
1 changed files with 4 additions and 0 deletions
|
|
@ -318,6 +318,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){
|
||||
__strong __typeof(&*weakSelf)strongSelf = weakSelf;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue