ref #6566 Fix potential infinite loop
authorPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 18 May 2017 08:36:26 +0000 (10:36 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 18 May 2017 08:36:26 +0000 (10:36 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java

index 6dbfaa8768daa77c20d36b3b1c09e92290bdad76..6b05de7516303c796bda17b6f42c91129c551e7f 100644 (file)
@@ -3,6 +3,7 @@ package eu.etaxonomy.taxeditor.editor.view.derivate;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -506,6 +507,7 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
             return;
         }
         if(listenToSelectionChange){
+            selectedTaxon = null;
             if(activePart instanceof MultiPageTaxonEditor){
                 selectedTaxon = ((MultiPageTaxonEditor) activePart).getTaxon();
             }
@@ -531,6 +533,9 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
 
                 thisPart.setLabel(SPECIMEN_EDITOR+": " + selectedTaxon.getName()); //$NON-NLS-1$
             }
+            else{
+                updateRootEntities((Collection<UUID>)Collections.EMPTY_LIST);
+            }
         }
     }