Revision d18e9075
Added by Andreas Müller over 1 year ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/portal/PortalDtoLoader.java | ||
---|---|---|
672 | 672 |
Map<UUID,Set<DescriptionElementBase>> featureMap = loadFeatureMap(taxon); |
673 | 673 |
|
674 | 674 |
//load final result |
675 |
if (!filteredRootNode.getChildren().isEmpty()) { |
|
675 |
if (filteredRootNode != null && !filteredRootNode.getChildren().isEmpty()) {
|
|
676 | 676 |
ContainerDto<FeatureDto> features = new ContainerDto<>(); |
677 | 677 |
for (TreeNode<Feature,UUID> node : filteredRootNode.getChildren()) { |
678 | 678 |
handleFeatureNode(config, featureMap, features, node); |
... | ... | |
694 | 694 |
|
695 | 695 |
//filter, sort and structure according to feature tree |
696 | 696 |
TreeNode<Feature, UUID> filteredRootNode; |
697 |
if (config.getFeatureTree() != null) { |
|
698 |
|
|
699 |
//TODO class cast |
|
700 |
TermTree<Feature> featureTree = repository.getTermTreeService().find(config.getFeatureTree()); |
|
701 |
filteredRootNode = filterFeatureNode(featureTree.getRoot(), existingFeatureUuids.keySet()); |
|
702 |
} else { |
|
697 |
//DIFFERENT |
|
698 |
// if (config.getFeatureTree() != null) { |
|
699 |
// |
|
700 |
// //TODO class cast |
|
701 |
// TermTree<Feature> featureTree = repository.getTermTreeService().find(config.getFeatureTree()); |
|
702 |
// filteredRootNode = filterFeatureNode(featureTree.getRoot(), existingFeatureUuids.keySet()); |
|
703 |
// } else { |
|
703 | 704 |
filteredRootNode = createDefaultFeatureNode(name); |
704 |
}
|
|
705 |
// } //DIFFERENT END
|
|
705 | 706 |
|
706 | 707 |
//load facts per feature |
707 | 708 |
Map<UUID,Set<DescriptionElementBase>> featureMap = loadFeatureMap(name); |
... | ... | |
850 | 851 |
//if any child is required or this node is required .... |
851 | 852 |
if (!requiredChildNodes.isEmpty() || |
852 | 853 |
featureNode.getTerm() != null && existingFeatureUuids.contains(featureNode.getTerm().getUuid())) { |
854 |
|
|
853 | 855 |
TreeNode<Feature,UUID> result = new TreeNode<>(); |
854 | 856 |
//add this nodes data |
855 | 857 |
Feature feature = featureNode.getTerm() == null ? null : featureNode.getTerm(); |
Also available in: Unified diff
ref #10222 fix NPE for empty featureNode and incorrect feature filter for name facts