Project

General

Profile

Revision 62079f03

ID62079f0371543d34bde1fe550ecee2c0f7ea13eb
Parent 7b690399
Child e7e44c01, e4f9e245

Added by Patrick Plitzner about 3 years ago

fix #7738 Fix potential NPE

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AbstractAddDerivativeHandler.java
67 67
	    Object createdElement = null;
68 68
	    SpecimenOrObservationBase<?> specimenOrObservationBase = (SpecimenOrObservationBase<?>) selectedDerivative;
69 69
	    DerivedUnit derivedUnit = createDerivative();
70
	    specimenOrObservationBase.addDerivationEvent(DerivationEvent.NewSimpleInstance(specimenOrObservationBase, derivedUnit, getDerivationeType()));
71
	    derivedUnit.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
72
	    derivedUnit.getTitleCache(); //update title cache
73
	    createdElement = derivedUnit;
74
	    CdmStore.getService(IOccurrenceService.class).merge((SpecimenOrObservationBase<?>) selectedDerivative, true);
70
	    if(derivedUnit!=null){
71
	        specimenOrObservationBase.addDerivationEvent(DerivationEvent.NewSimpleInstance(specimenOrObservationBase, derivedUnit, getDerivationeType()));
72
	        derivedUnit.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
73
	        derivedUnit.getTitleCache(); //update title cache
74
	        createdElement = derivedUnit;
75
	        CdmStore.getService(IOccurrenceService.class).merge((SpecimenOrObservationBase<?>) selectedDerivative, true);
76
	    }
75 77
	    return createdElement;
76 78
	}
77 79

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)