Info message when trying to open non-persisted IndividualsAssociations
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 4 Apr 2016 04:28:27 +0000 (06:28 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 4 Apr 2016 13:31:44 +0000 (15:31 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForDescriptionElement.java

index 698d7938b41114a5a3c34b28f7fe24ef38c44683..1d1dbde7bb79a5f10e34f16830bc574fbdd24cfb 100644 (file)
@@ -30,6 +30,10 @@ public class OpenDerivativeEditorForDescriptionElement extends DefaultOpenHandle
 
     @Override
     protected void open(ExecutionEvent event, IndividualsAssociation entity) {
+       if(entity==null || entity.getAssociatedSpecimenOrObservation()==null){
+               MessagingUtils.messageDialog("No specimens found", this, "No specimens found for the selected object. (Maybe there are unsaved changes)");
+               return;
+       }
         SpecimenOrObservationBase associatedSpecimenOrObservation = entity.getAssociatedSpecimenOrObservation();
         if(associatedSpecimenOrObservation!=null){
             UUID specimenUuid = associatedSpecimenOrObservation.getUuid();