Skip to content

Commit

Permalink
FIX: fix download resume path bug
Browse files Browse the repository at this point in the history
Change-Id: I4f8e7c8c9f176c6957e2c82611e180ea50311530
  • Loading branch information
lijl02 authored and shangcr committed Oct 29, 2019
1 parent 0d14ab8 commit 0c19b4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion YTKNetwork.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "YTKNetwork"
s.version = "2.0.5"
s.version = "2.0.6"
s.summary = "YTKNetwork is a high level request util based on AFNetworking."
s.homepage = "https://github.com/yuantiku/YTKNetwork"
s.license = "MIT"
Expand Down
5 changes: 4 additions & 1 deletion YTKNetwork/YTKNetworkAgent.m
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ - (void)requestDidFailWithRequest:(YTKBaseRequest *)request error:(NSError *)err

// Save incomplete download data.
NSData *incompleteDownloadData = error.userInfo[NSURLSessionDownloadTaskResumeData];
NSURL *localUrl = [self incompleteDownloadTempPathForDownloadPath:request.resumableDownloadPath];
NSURL *localUrl = nil;
if (request.resumableDownloadPath) {
localUrl = [self incompleteDownloadTempPathForDownloadPath:request.resumableDownloadPath];
}
if (incompleteDownloadData && localUrl != nil) {
[incompleteDownloadData writeToURL:localUrl atomically:YES];
}
Expand Down

0 comments on commit 0c19b4b

Please sign in to comment.