fix(文件管理): 异常数据保护
This commit is contained in:
parent
627f75172b
commit
ea2b7e9649
|
@ -165,12 +165,16 @@ public class FileAssociationService {
|
||||||
|
|
||||||
private List<BodyFile> getRefFiles(Body body) {
|
private List<BodyFile> getRefFiles(Body body) {
|
||||||
List<BodyFile> files = new ArrayList<>();
|
List<BodyFile> files = new ArrayList<>();
|
||||||
|
if (body != null && !CollectionUtils.isEmpty(body.getKvs())) {
|
||||||
body.getKvs().stream().filter(KeyValue::isFile).filter(KeyValue::isEnable).forEach(keyValue -> {
|
body.getKvs().stream().filter(KeyValue::isFile).filter(KeyValue::isEnable).forEach(keyValue -> {
|
||||||
files.addAll(keyValue.getFiles().stream().filter(BodyFile::isRef).collect(Collectors.toList()));
|
files.addAll(keyValue.getFiles().stream().filter(BodyFile::isRef).collect(Collectors.toList()));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
if (body != null && !CollectionUtils.isEmpty(body.getBinary())) {
|
||||||
body.getBinary().stream().filter(KeyValue::isFile).filter(KeyValue::isEnable).forEach(keyValue -> {
|
body.getBinary().stream().filter(KeyValue::isFile).filter(KeyValue::isEnable).forEach(keyValue -> {
|
||||||
files.addAll(keyValue.getFiles().stream().filter(BodyFile::isRef).collect(Collectors.toList()));
|
files.addAll(keyValue.getFiles().stream().filter(BodyFile::isRef).collect(Collectors.toList()));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue