Merge branch 'release/5.28.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / occurrence / AbstractEventDetailElement.java
index 7eb029ea11044df3d8ee7dc68d5d5ad5dd5eec19..9b2e9f2c2b35fb8c30233a850907551f9ff7550f 100644 (file)
@@ -65,9 +65,11 @@ public abstract class AbstractEventDetailElement<T extends EventBase> extends
        /** {@inheritDoc} */
        @Override
        public void setEntity(T entity) {
-               selection_agent.setEntity(entity.getActor());
-               text_description.setText(entity.getDescription());
-               element_timePeriod.setEntity(entity.getTimeperiod());
+               if (selection_agent != null){
+                       selection_agent.setEntity(entity.getActor());
+                       text_description.setText(entity.getDescription());
+                       element_timePeriod.setEntity(entity.getTimeperiod());
+               }
        }
 
 
@@ -82,6 +84,11 @@ public abstract class AbstractEventDetailElement<T extends EventBase> extends
                                "Time Period", null, style);
                text_description = formFactory.createTextWithLabelElement(element,
                                "Description", null, style);
+               if (entity != null){
+                       selection_agent.setEntity(entity.getActor());
+                       text_description.setText(entity.getDescription());
+                       element_timePeriod.setEntity(entity.getTimeperiod());
+               }
        }
 
 }