Skip to content

Commit

Permalink
Resolve formula regressions in cdk-data. A new test was added to chec…
Browse files Browse the repository at this point in the history
…k for NPEs when adding formula, only cdk-silent updated.

Change-Id: I858ff5ddb64f44a1b9c99653b382ffdd3b47e307
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay authored and egonw committed Nov 9, 2014
1 parent 37bb41c commit 55c8bbe
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -91,7 +91,12 @@ public IMolecularFormula add(IMolecularFormula formula) {
for (IIsotope newIsotope : formula.isotopes()) {
addIsotope(newIsotope, formula.getIsotopeCount(newIsotope));
}
if (formula.getCharge() != null) charge += formula.getCharge();
if (formula.getCharge() != null) {
if (charge != null)
charge += formula.getCharge();
else
charge = formula.getCharge();
}
return this;
}

Expand Down

0 comments on commit 55c8bbe

Please sign in to comment.