Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
[Issue #274] Fixing crash when creating network reachability when bas…
Browse files Browse the repository at this point in the history
…eURL is nil
  • Loading branch information
mattt committed Apr 25, 2012
1 parent 51bd23d commit ce23a07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions AFNetworking/AFHTTPClient.m
Expand Up @@ -372,10 +372,14 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
}

- (void)startMonitoringNetworkReachability {
[self stopMonitoringNetworkReachability];
[self stopMonitoringNetworkReachability];

if (!self.baseURL) {
return;
}

self.networkReachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [[self.baseURL host] UTF8String]);

AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status){
self.networkReachabilityStatus = status;
if (self.networkReachabilityStatusBlock) {
Expand Down

0 comments on commit ce23a07

Please sign in to comment.