Project

General

Profile

« Previous | Next » 

Revision 248f5a5a

Added by Patrick Plitzner about 8 years ago

Fix NPE when adding new taxon to classification

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java
56 56
            Reference sec = taxon.getSec();
57 57
            taxon.setSec(null);
58 58
            try{
59
            	UpdateResult result = CdmStore.getService(ITaxonNodeService.class).createNewTaxonNode(parent.getUuid(), taxon, parent.getReference(), parent.getMicroReference());
60
            		
59
            	UUID parentNodeUuid;
60
            	if(parent instanceof Classification){
61
            	    parentNodeUuid = ((Classification) parent).getRootNode().getUuid();
62
            	}
63
            	else{
64
            	    parentNodeUuid = parent.getUuid();
65
            	}
66
                UpdateResult result = CdmStore.getService(ITaxonNodeService.class).createNewTaxonNode(parentNodeUuid, taxon, parent.getReference(), parent.getMicroReference());
67

  
61 68
                //TaxonNode taxonNode = parent.addChildTaxon(taxon, parent.getReference(), parent.getMicroReference());
62 69

  
63 70
              /*  if(CdmStore.getCurrentSessionManager().isRemoting()) {
......
79 86
                        affectedObjects.add(parentNode);
80 87
                    }
81 88
                }
82
                
83 89

  
84
                
90

  
91

  
85 92

  
86 93
                if(CdmStore.getCurrentSessionManager().isRemoting()) {
87 94
                    CdmApplicationState.getCurrentDataChangeService()

Also available in: Unified diff