Fix possible NoSuchElementException
authorPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 26 Jul 2018 15:09:21 +0000 (17:09 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 26 Jul 2018 15:30:50 +0000 (17:30 +0200)
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/DescriptiveDataSetService.java

index a1ea52e1c7f5078232be211a1827f7b31c41faa0..9ed2428dc14d628bb88ef4c88be88b04659a722f 100644 (file)
@@ -155,7 +155,7 @@ public class DescriptiveDataSetService
                                 "taxonNodes",
                                 "taxonNodes.classification",
                         }));
-                if(associatedTaxa!=null){
+                if(associatedTaxa!=null && !associatedTaxa.isEmpty()){
                     //FIXME: what about multiple associated taxa
                     Set<TaxonNode> taxonSubtreeFilter = descriptiveDataSet.getTaxonSubtreeFilter();
                     if(taxonSubtreeFilter!=null && !taxonSubtreeFilter.isEmpty()){