possible NPE fix
authorAndreas Müller <a.mueller@bgbm.org>
Wed, 20 Jun 2012 10:02:04 +0000 (10:02 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 20 Jun 2012 10:02:04 +0000 (10:02 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java

index 7e0c39fd94278274461bcba71bdbd15e97d761e8..65403941dd6a7d7ba04c7f491a9fc887098e7607 100644 (file)
@@ -23,6 +23,7 @@ import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.ITreeNode;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
@@ -108,8 +109,8 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        
        TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid);
        
-       if(taxonBase instanceof Taxon){
-               Taxon taxon = (Taxon) taxonBase;
+       if(taxonBase.isInstanceOf(Taxon.class)){
+               Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
                
                if (taxon.isMisapplication()){
                        // TODO get accepted taxon