Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

do not attempt to start connection when URL is nil

  • Loading branch information...
commit 48e13928d0386779a332392d462e98f8ad4009cf 1 parent 3a921e8
@ettore authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/Three20Network/Sources/TTRequestLoader.m
View
9 src/Three20Network/Sources/TTRequestLoader.m
@@ -124,18 +124,19 @@ - (void)connectToURL:(NSURL*)URL {
[self performSelector:@selector(deliverDataResponse:) withObject:URL afterDelay:0.1];
return;
}
- TTNetworkRequestStarted();
-
TTURLRequest* request = _requests.count >= 1 ? [_requests objectAtIndex:0] : nil;
// there are situations where urlPath is somehow nil (therefore crashing in
// createNSURLRequest:URL:, even if we checked for non-blank values before
// adding the request to the queue.
- if (!request.urlPath.length)
+ if (!request.urlPath.length) {
[self cancel:request];
+ if (URL == nil)
+ return; // no url whatsoever, nothing to do here
+ }
+ TTNetworkRequestStarted();
NSURLRequest* URLRequest = [_queue createNSURLRequest:request URL:URL];
-
_connection = [[NSURLConnection alloc] initWithRequest:URLRequest delegate:self];
}
Please sign in to comment.
Something went wrong with that request. Please try again.