Commit 7fcea0021f73c2cd5ec1511ea3cd4ebcbee850ad

Authored by 梁星国
1 parent 95de71f5

提交添加路径判断

CNLiveUploadManager/Classes/CNLiveUploadManager.m
@@ -916,8 +916,14 @@ static CNLiveUploadManager *_uploadManager; @@ -916,8 +916,14 @@ static CNLiveUploadManager *_uploadManager;
916 } 916 }
917 917
918 //上传路径 918 //上传路径
  919 + if ([NSString isEmpty:outputPath]) {
  920 + NSError *error = [NSError errorWithDomain:@"上传路径为空" code:101 userInfo:@{NSLocalizedDescriptionKey:@"上传路径为空,请重新获取"}];
  921 + !failure ? : failure(nil,error);
  922 + return;
  923 + }
  924 +
919 if (!asset) { 925 if (!asset) {
920 - NSError *error = [NSError errorWithDomain:@"上传路径为空" code:101 userInfo:@{NSLocalizedDescriptionKey:@"上传为空,请重新获取"}]; 926 + NSError *error = [NSError errorWithDomain:@"上传内容为空" code:101 userInfo:@{NSLocalizedDescriptionKey:@"上传内容为空,请重新获取"}];
921 !failure ? : failure(nil,error); 927 !failure ? : failure(nil,error);
922 return; 928 return;
923 } 929 }
@@ -970,7 +976,7 @@ static CNLiveUploadManager *_uploadManager; @@ -970,7 +976,7 @@ static CNLiveUploadManager *_uploadManager;
970 } 976 }
971 977
972 //上传路径 978 //上传路径
973 - if (!asset) { 979 + if ([NSString isEmpty:outputPath]) {
974 dispatch_async(dispatch_get_main_queue(), ^{ 980 dispatch_async(dispatch_get_main_queue(), ^{
975 NSError *error = [NSError errorWithDomain:@"上传路径为空" code:101 userInfo:@{NSLocalizedDescriptionKey:@"上传为空,请重新获取"}]; 981 NSError *error = [NSError errorWithDomain:@"上传路径为空" code:101 userInfo:@{NSLocalizedDescriptionKey:@"上传为空,请重新获取"}];
976 !failure ? : failure(nil,error); 982 !failure ? : failure(nil,error);
@@ -979,6 +985,15 @@ static CNLiveUploadManager *_uploadManager; @@ -979,6 +985,15 @@ static CNLiveUploadManager *_uploadManager;
979 985
980 } 986 }
981 987
  988 + if (!asset) {
  989 + dispatch_async(dispatch_get_main_queue(), ^{
  990 + NSError *error = [NSError errorWithDomain:@"上传内容为空" code:101 userInfo:@{NSLocalizedDescriptionKey:@"上传内容为空,请重新获取"}];
  991 + !failure ? : failure(nil,error);
  992 + return;
  993 + });
  994 +
  995 + }
  996 +
982 997
983 __weak typeof(self) weakSelf = self; 998 __weak typeof(self) weakSelf = self;
984 999