Skip to content

Commit

Permalink
Add early exit to return error only when not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
SoneeJohn committed Feb 19, 2020
1 parent 8bccc9d commit 5577be3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions XCDYouTubeKit/XCDURLGetOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ - (void) URLSession:(NSURLSession *)session task:(NSURLSessionTask *)dataTask di
if (self.isCancelled)
return;

if (error == nil)
{
[self finish];
return;
}

[self finishWithError:error];
}

Expand Down

0 comments on commit 5577be3

Please sign in to comment.