Browse Source

流程审批附件空指针判断

lijie 2 years ago
parent
commit
29df4384f6
1 changed files with 6 additions and 0 deletions
  1. 6 0
      mhotel/src/com/happy/action/WorkflowAction.java

+ 6 - 0
mhotel/src/com/happy/action/WorkflowAction.java

@@ -118,6 +118,12 @@ public class WorkflowAction  extends ActionSupport implements ServletRequestAwar
                     if (workflow.getStatus() == 2){//审批通过
                     if (workflow.getStatus() == 2){//审批通过
                         // 新的酒店图片
                         // 新的酒店图片
                         List<FileInfo> fileInfoList = fileService.queryList("and link_id ='"+workflow1.getId()+"'");
                         List<FileInfo> fileInfoList = fileService.queryList("and link_id ='"+workflow1.getId()+"'");
+                        if(fileInfoList == null){
+                            resultJson.put("message", "附件为空!");
+                            resultJson.put("code", 500);
+                            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+                            return null;
+                        }
                         fileService.delLinkFile(String.valueOf(workflow1.getLinkId()));
                         fileService.delLinkFile(String.valueOf(workflow1.getLinkId()));
                         fileInfoList.forEach(file -> {
                         fileInfoList.forEach(file -> {
                             file.setLinkId(workflow1.getLinkId());
                             file.setLinkId(workflow1.getLinkId());