Commit 63af58bf by jinxin

空指针异常处理

parent 17da138a
......@@ -222,7 +222,7 @@ public class MaterialServiceImpl implements MaterialService {
int count = arr.length;
if(from==2) {
// 朋友圈上传接口
if (type == 2) {
if (type == 2 || type == 4) {
if(url.contains("?")) {
logger.info("url有参数={}",url);
url = url.split("\\?")[0] ;
......@@ -235,7 +235,8 @@ public class MaterialServiceImpl implements MaterialService {
// 群发上传
jp = qywxSuiteApiService.uploadMedia(qwDTO.getThirdCorpid(), config.getWxSuiteid(), CommonUtil.getFileByte(url), arr[count - 1], fileType.getCode());
}
if (jp.getErrorCode() == 0) {
// int是基本类型 默认值为0
if (jp.isSuccess()) {
if(from==1) {
old.setWxLastUploadTime(new Date());
old.setMediaId(jp.getResult().toString());
......
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