Navigation Menu

Skip to content

Commit

Permalink
Do not set property if calculation failed
Browse files Browse the repository at this point in the history
fix for bug Bug 3232
  • Loading branch information
goglepox committed Aug 21, 2012
1 parent e9198f2 commit 584222e
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -224,8 +224,10 @@ public void calculateProperty( IMoleculesEditorModel model,
for(IPropertyCalculator<?> calculator:calculators) {
calculateProgress.subTask( String.format( "%d/%d", prop++,
calculators.length) );
model.setPropertyFor( i, calculator.getPropertyName(),
calculator.calculate( model.getMoleculeAt( i ) ) );
Object property = calculator.calculate(model.getMoleculeAt(i));
if(property!= null) {
model.setPropertyFor( i, calculator.getPropertyName(),property);
}
calculateProgress.worked( 100 );
if(progress.isCanceled())
throw new OperationCanceledException();
Expand Down

0 comments on commit 584222e

Please sign in to comment.