解决空指针异常

master
guoxin 1 year ago
parent 45bf401db5
commit 776191c004
  1. 4
      shandan-control/src/main/java/com/keyware/shandan/control/controller/FIleRepairController.java

@ -11,6 +11,7 @@ import com.keyware.shandan.frame.properties.CustomProperties;
import com.keyware.shandan.system.entity.SysFile;
import com.keyware.shandan.system.entity.SysFileChunk;
import com.keyware.shandan.system.entity.SysSetting;
import com.keyware.shandan.system.entity.SysUser;
import com.keyware.shandan.system.service.SysFileService;
import com.keyware.shandan.system.service.SysUserService;
import com.keyware.shandan.system.utils.FileChunkUploadUtil;
@ -76,7 +77,8 @@ public class FIleRepairController {
data.put("fileType", file.getFileType());
data.put("fileSize", file.getFileSize());
data.put("createTime", DateUtil.format(file.getModifyTime(), "yyyy-MM-dd HH:mm"));
data.put("createUser", userService.getById(file.getModifyUser()).getUserName());
SysUser user = userService.getById(file.getModifyUser());
data.put("createUser", user == null ? file.getModifyUser() : user.getUserName());
fileMap.put(file.getId(), data);
}
}