Skip to content

Commit

Permalink
fix warning "Null passed to a callee that requires a non-null argument"
Browse files Browse the repository at this point in the history
  • Loading branch information
loadmemo committed Aug 8, 2016
1 parent cf481c5 commit e7609f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TCBlobDownload/TCBlobDownload/TCBlobDownloader.m
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ - (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLRespons
}

if (!error) {
[self.receivedDataBuffer setData:nil];
[self.receivedDataBuffer setData:[NSData dataWithBytes:NULL length:0]];

dispatch_async(dispatch_get_main_queue(), ^{
if (self.firstResponseBlock) {
Expand Down Expand Up @@ -253,7 +253,7 @@ - (void)connection:(NSURLConnection*)connection didReceiveData:(NSData *)data

if (self.receivedDataBuffer.length > kBufferSize && [self isExecuting]) {
[self.file writeData:self.receivedDataBuffer];
[self.receivedDataBuffer setData:nil];
[self.receivedDataBuffer setData:[NSData dataWithBytes:NULL length:0]];
}

dispatch_async(dispatch_get_main_queue(), ^{
Expand All @@ -273,7 +273,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection*)connection
{
if ([self isExecuting]) {
[self.file writeData:self.receivedDataBuffer];
[self.receivedDataBuffer setData:nil];
[self.receivedDataBuffer setData:[NSData dataWithBytes:NULL length:0]];

[self notifyFromCompletionWithError:nil pathToFile:self.pathToFile];
}
Expand Down

0 comments on commit e7609f2

Please sign in to comment.