fix possible NPE
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / descriptiveDataSet / matrix / CharacterMatrixConfigLabelAccumulator.java
index 65a24f5c6b81a0105e5a92223a2aec6cb6dc57bf..01bbd805420648361178c2e414df73c95e5c039e 100644 (file)
@@ -149,9 +149,9 @@ public class CharacterMatrixConfigLabelAccumulator implements IConfigLabelAccumu
     }
 
     private boolean hasDefaultValue(Feature feature, RowWrapperDTO<?> rowWrapperDTO) {
-        if(rowWrapperDTO instanceof SpecimenRowWrapperDTO){
-            SpecimenRowWrapperDTO specimenRowWrapper = (SpecimenRowWrapperDTO)rowWrapperDTO;
-            return hasDefaultValue(feature, specimenRowWrapper.getDefaultDescription().getDescription());
+        if(rowWrapperDTO instanceof SpecimenRowWrapperDTO
+                && ((SpecimenRowWrapperDTO) rowWrapperDTO).getDefaultDescription()!=null){
+            return hasDefaultValue(feature, ((SpecimenRowWrapperDTO)rowWrapperDTO).getDefaultDescription().getDescription());
         }
         else if(rowWrapperDTO instanceof TaxonRowWrapperDTO){
             TaxonRowWrapperDTO taxonRowWrapper = (TaxonRowWrapperDTO)rowWrapperDTO;