Project

General

Profile

« Previous | Next » 

Revision 0fc5c09c

Added by Patrick Plitzner over 8 years ago

Fix possible NPE

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java
95 95
                @Override
96 96
                public String getText(Object element) {
97 97
                    SpecimenTypeDesignation typeDesignation = (SpecimenTypeDesignation)element;
98
                    String label = typeDesignation.getTypeStatus().getLabel()+" of ";
99
                        Set<TaxonNameBase> typifiedNames = typeDesignation.getTypifiedNames();
100
                        for (TaxonNameBase taxonNameBase : typifiedNames) {
101
                            label += taxonNameBase+", ";
102
                        }
103
                        if(label.endsWith(", ")){
104
                            label = label.substring(0, label.length()-2);
105
                        }
98
                    String label = typeDesignation.getTypeStatus()!=null?typeDesignation.getTypeStatus().getLabel()+" of ":"Type of ";
99
                    Set<TaxonNameBase> typifiedNames = typeDesignation.getTypifiedNames();
100
                    for (TaxonNameBase taxonNameBase : typifiedNames) {
101
                        label += taxonNameBase+", ";
102
                    }
103
                    if(label.endsWith(", ")){
104
                        label = label.substring(0, label.length()-2);
105
                    }
106 106
                    return label;
107 107
                }
108 108
            });

Also available in: Unified diff