Skip to content

Commit baae4da

Browse files
committed
Don't correct for null charge.
1 parent f809e7a commit baae4da

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,8 @@ public static double getTotalExactMass(IMolecularFormula formula) {
813813
* @return The mass with the correction
814814
*/
815815
private static double correctMass(double mass, Integer charge) {
816+
if (charge == null)
817+
return mass;
816818
double massE = 0.00054857990927;
817819
if (charge > 0)
818820
mass -= massE * charge;

0 commit comments

Comments
 (0)