diff --git a/src/main/org/openscience/cdk/inchi/InChIGenerator.java b/src/main/org/openscience/cdk/inchi/InChIGenerator.java
index <HASH>..<HASH> 100644
--- a/src/main/org/openscience/cdk/inchi/InChIGenerator.java
+++ b/src/main/org/openscience/cdk/inchi/InChIGenerator.java
@@ -218,15 +218,15 @@ public class InChIGenerator {
             }

             

             // Check whether isotopic

-            int isotopeNumber = atom.getMassNumber();

-            if (isotopeNumber > 0 && ifact != null) {

+            Integer isotopeNumber = atom.getMassNumber();

+            if (isotopeNumber != CDKConstants.UNSET && ifact != null) {

                 IAtom isotope = atomContainer.getBuilder().newAtom(el);

                 ifact.configure(isotope);

-                if (isotope.getMassNumber() == isotopeNumber) {

+                if (isotope.getMassNumber().intValue() == isotopeNumber.intValue()) {

                     isotopeNumber = 0;

                 }

             }

-            if (isotopeNumber != 0) {

+            if (isotopeNumber != CDKConstants.UNSET) {

                 iatom.setIsotopicMass(isotopeNumber);

             }
Fixed a NPE caused by mass number now being an Object instead of native

git-svn-id: <URL>