ref #9816: quantitative data editor needs to handle new descr element correctly
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / descriptiveDataSet / matrix / quantitative / QuantitativeDataDialogEditor.java
index fade75999b3a3e45b201eb530fb24e6776bb0673..615978f59b6f3f2441e732b915a437a9ab66637c 100644 (file)
@@ -102,13 +102,17 @@ public class QuantitativeDataDialogEditor extends AbstractDialogCellEditor {
             if (dataValueForFeature != null && dataValueForFeature.size() > 1){
                return null;
             }
-            Iterator<DescriptionElementDto> it = dataValueForFeature.iterator();
-            if(it.hasNext() ){
-               DescriptionElementDto dto = it.next();
-               if(dto instanceof QuantitativeDataDto){
-                       quantitativeData = (QuantitativeDataDto) dto;
-               }
+            
+            DescriptionElementDto dto = null;
+            if (dataValueForFeature != null){
+               Iterator<DescriptionElementDto> it = dataValueForFeature.iterator();
+                   if(it.hasNext() ){
+                       dto = it.next();                        
+                   }
             }
+            if(dto instanceof QuantitativeDataDto){
+                       quantitativeData = (QuantitativeDataDto) dto;
+               }
             //create new Quantitative Data
             if (quantitativeData == null) {
                 quantitativeData = ((RowWrapperDTO) rowObject).addQuantitativeData(feature);