ref #9838: change order of ui element creation and setting entity in collection elements
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / occurrence / dna / SequenceReferenceCollectionDetailElement.java
index cb489119da23b409bab2cf73421d4cabc92ffeb5..55473d44328c0ebc40f76b28cbcf252ad04d85e7 100644 (file)
@@ -44,13 +44,19 @@ public class SequenceReferenceCollectionDetailElement
                         null, EntitySelectionElement.SELECTABLE|EntitySelectionElement.EDITABLE, style);
         text_referenceDetail = formFactory.createTextWithLabelElement(
                 formElement, "Reference Detail", null, SWT.NULL);
+        if (entity != null){
+               setEntity(entity);
+        }
     }
 
     @Override
     public void setEntity(Reference entity) {
         this.entity = entity;
-        selection_reference.setEntity(entity);
-        text_referenceDetail.setText(entity.getReferenceAbstract());
+        if(selection_reference != null){
+               selection_reference.setEntity(entity);
+               text_referenceDetail.setText(entity.getReferenceAbstract());
+        }
+        
     }
 
     @Override