Skip to content

Commit

Permalink
Fix for a nasty bug after investigating for #21
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Apr 6, 2014
1 parent f714711 commit b96f983
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TCBlobDownload/TCBlobDownload/TCBlobDownloader.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ - (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLRespons
//NSLog(@"%u", (unsigned)[[UIDevice currentDevice] freeDiskSpace].longLongValue);
//NSLog(@"%lld", self.expectedDataLength);

if ((unsigned)[[UIDevice currentDevice] freeDiskSpace].longLongValue < self.expectedDataLength) {
NSInteger expected = @(self.expectedDataLength).longLongValue;
if ([[UIDevice currentDevice] freeDiskSpace].longLongValue < expected && expected != -1) {

error = [NSError errorWithDomain:kErrorDomain
code:TCErrorNotEnoughFreeDiskSpace
userInfo:@{ NSLocalizedDescriptionKey:NSLocalizedString(@"Not enough free disk space", @"") }];
Expand Down

0 comments on commit b96f983

Please sign in to comment.