Commit 4c6020a7 authored by yuzheng's avatar yuzheng

强壮逻辑,保存图片时若未拿到localIdentifier则进入失败逻辑

parent 9e903093
......@@ -511,10 +511,12 @@ static dispatch_once_t onceToken;
request.creationDate = [NSDate date];
} completionHandler:^(BOOL success, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (success && completion) {
if (success && completion && localIdentifier) {
[self fetchAssetByIocalIdentifier:localIdentifier retryCount:10 completion:completion];
} else if (error) {
} else {
if (error) {
NSLog(@"保存照片出错:%@",error.localizedDescription);
}
if (completion) {
completion(nil, error);
}
......@@ -547,10 +549,12 @@ static dispatch_once_t onceToken;
} completionHandler:^(BOOL success, NSError *error) {
[[NSFileManager defaultManager] removeItemAtPath:path error:nil];
dispatch_async(dispatch_get_main_queue(), ^{
if (success && completion) {
if (success && completion && localIdentifier) {
[self fetchAssetByIocalIdentifier:localIdentifier retryCount:10 completion:completion];
} else if (error) {
} else {
if (error) {
NSLog(@"保存照片出错:%@",error.localizedDescription);
}
if (completion) {
completion(nil, error);
}
......@@ -589,10 +593,12 @@ static dispatch_once_t onceToken;
request.creationDate = [NSDate date];
} completionHandler:^(BOOL success, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (success && completion) {
if (success && completion && localIdentifier) {
[self fetchAssetByIocalIdentifier:localIdentifier retryCount:10 completion:completion];
} else if (error) {
} else {
if (error) {
NSLog(@"保存视频出错:%@",error.localizedDescription);
}
if (completion) {
completion(nil, error);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment