浏览代码

流程审批附件空指针判断

lijie 3 年之前
父节点
当前提交
29df4384f6
共有 1 个文件被更改,包括 6 次插入0 次删除
  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){//审批通过
                         // 新的酒店图片
                         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()));
                         fileInfoList.forEach(file -> {
                             file.setLinkId(workflow1.getLinkId());