Fix possible NPE
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 7 Dec 2015 14:25:15 +0000 (15:25 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 7 Dec 2015 14:25:15 +0000 (15:25 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java

index eb81115f57c8a903d7e09914d26aaa206e18ff89..697565e07800dcf182fc2e883cfb2aa549dbfd88 100644 (file)
@@ -95,14 +95,14 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<Deri
                 @Override
                 public String getText(Object element) {
                     SpecimenTypeDesignation typeDesignation = (SpecimenTypeDesignation)element;
-                    String label = typeDesignation.getTypeStatus().getLabel()+" of ";
-                        Set<TaxonNameBase> typifiedNames = typeDesignation.getTypifiedNames();
-                        for (TaxonNameBase taxonNameBase : typifiedNames) {
-                            label += taxonNameBase+", ";
-                        }
-                        if(label.endsWith(", ")){
-                            label = label.substring(0, label.length()-2);
-                        }
+                    String label = typeDesignation.getTypeStatus()!=null?typeDesignation.getTypeStatus().getLabel()+" of ":"Type of ";
+                    Set<TaxonNameBase> typifiedNames = typeDesignation.getTypifiedNames();
+                    for (TaxonNameBase taxonNameBase : typifiedNames) {
+                        label += taxonNameBase+", ";
+                    }
+                    if(label.endsWith(", ")){
+                        label = label.substring(0, label.length()-2);
+                    }
                     return label;
                 }
             });