Fix refresh problem when creating a FieldUnit with no previous viewer
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / derivate / DerivateView.java
index 0d587c2c294ef79004b03d65294866780e5c27f4..811c1e3343a34bb7fd07b8585d9a661f75fa95b2 100644 (file)
@@ -231,13 +231,13 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
                 cdmEntitySession.bind();
             }
 
+            List<SpecimenOrObservationBase> derivates = null;
             if(derivativeUuids!=null){
                 this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
                 this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
-                List<SpecimenOrObservationBase> derivates =
-                        CdmStore.getService(IOccurrenceService.class).load(new ArrayList(derivativeUuids), SPECIMEN_INIT_STRATEGY);
-                updateRootEntities(derivates);
+                derivates = CdmStore.getService(IOccurrenceService.class).load(new ArrayList(derivativeUuids), SPECIMEN_INIT_STRATEGY);
             }
+            updateRootEntities(derivates);
             refreshTree(false);
             previousCdmEntitySession.bind();
         }