handle NPE in Description Helper for Markers
authorAndreas Müller <a.mueller@bgbm.org>
Mon, 6 May 2013 17:47:42 +0000 (17:47 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 6 May 2013 17:47:42 +0000 (17:47 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java

index bada117220dbfd9975e381ca66da82d828ecf4d5..328f57a227ff68de1d8e68e25783ffa19dfac312 100644 (file)
@@ -27,6 +27,7 @@ import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.common.LanguageStringBase;
 import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.common.OriginalSourceBase;
 import eu.etaxonomy.cdm.model.description.CategoricalData;
 import eu.etaxonomy.cdm.model.description.CommonTaxonName;
@@ -198,7 +199,8 @@ public class DescriptionHelper {
                }
                if (element instanceof Marker) {
                        Marker marker = (Marker) element;
-                       return marker.getMarkerType().getLabel() + " (" + marker.getFlag() + ")";
+                       MarkerType type = marker.getMarkerType();
+                       return (type == null ? "- no marker type -" : marker.getMarkerType().getLabel()) + " (" + marker.getFlag() + ")";
                }
                // TODO write return texts for NameRelationship, HomotypicalGroup, SpecimenTypeDesignation, etc.
                return element.toString();