Browse Source

REPORT-137781 设计器设置文件数据集选择文件npe

fbp/release
Destiny.Lin 1 month ago
parent
commit
dd3f695668
  1. 6
      designer-base/src/main/java/com/fr/file/FileDataFILE.java

6
designer-base/src/main/java/com/fr/file/FileDataFILE.java

@ -10,6 +10,7 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.server.repository.tabledata.TableDataRepository; import com.fr.workspace.server.repository.tabledata.TableDataRepository;
import javax.annotation.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -98,6 +99,9 @@ public class FileDataFILE extends FileNodeFILE{
FileDataFILE root = null; FileDataFILE root = null;
if (!this.builded) { if (!this.builded) {
root = buildTree(); root = buildTree();
if (root == null) {
return new FILE[0];
}
FileDataFILE dataFILE = root.getFileDataFILE(this.id); FileDataFILE dataFILE = root.getFileDataFILE(this.id);
this.setChildren(dataFILE.getChildren()); this.setChildren(dataFILE.getChildren());
this.setType(dataFILE.getType()); this.setType(dataFILE.getType());
@ -125,7 +129,7 @@ public class FileDataFILE extends FileNodeFILE{
return null; return null;
} }
private FileDataFILE buildTree() { private @Nullable FileDataFILE buildTree() {
List<FileNodeBean> beans = TableDataRepository.getInstance().getFileList(type); List<FileNodeBean> beans = TableDataRepository.getInstance().getFileList(type);
Map<String, FileDataFILE> tree = new HashMap<>(); Map<String, FileDataFILE> tree = new HashMap<>();
FileDataFILE root = null; FileDataFILE root = null;

Loading…
Cancel
Save