- fixed possible IllegalStateException (#4351)
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 18 Aug 2014 14:53:59 +0000 (14:53 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 18 Aug 2014 14:53:59 +0000 (14:53 +0000)
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/PolytomousKeyViewPart.java

index e61e1584228ed0a5a8a7412c5ab8e8d1e85a3cc3..6075a5062f122bba9aaa72f6a72341269d26685e 100644 (file)
@@ -91,7 +91,9 @@ public class PolytomousKeyViewPart extends ViewPart implements
                @Override
                public void contextStop(IMemento memento, IProgressMonitor monitor) {
                        monitor.subTask("Shutting down Polytomous Key Viewer");
-                       viewer.setInput(null);
+                       if(!viewer.getControl().isDisposed()){
+                           viewer.setInput(null);
+                       }
                }
 
                /* (non-Javadoc)
@@ -194,7 +196,9 @@ public class PolytomousKeyViewPart extends ViewPart implements
                conversation = CdmStore.createConversation();
                conversation.registerForDataStoreChanges(this);
                List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
-               viewer.setInput(input);
+               if(!viewer.getControl().isDisposed()){
+                   viewer.setInput(input);
+               }
        }
 
        /* (non-Javadoc)
@@ -263,7 +267,9 @@ public class PolytomousKeyViewPart extends ViewPart implements
                //FIXME : Need to make sure this is a stable fix (ticket 3822)
                getConversationHolder().commit();
                List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
-               viewer.setInput(input);
+               if(!viewer.getControl().isDisposed()){
+                   viewer.setInput(input);
+               }
        }
 
        public List<PolytomousKey> getKeys() {