Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Issue #274] Fixing crash when creating network reachability when bas…

…eURL is nil
  • Loading branch information...
commit ce23a0757b26c5f4190df52e73ae729be2255643 1 parent 51bd23d
Mattt Thompson mattt authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 AFNetworking/AFHTTPClient.m
8 AFNetworking/AFHTTPClient.m
View
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.