Skip to content

Commit

Permalink
Another NPE test: when the atomicNumber doesn't correspond to a isoto…
Browse files Browse the repository at this point in the history
…pe list

Change-Id: I9e25735117668c7c5e5b30336be39d0db2710816
Signed-off-by: John May <john.wilkinsonmay@gmail.com>
  • Loading branch information
egonw authored and johnmay committed Oct 21, 2013
1 parent 1fb8356 commit 0debacc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/org/openscience/cdk/config/Isotopes.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public IIsotope getIsotope(String symbol, double exactMass, double tolerance) {
*/
@TestMethod("testGetMajorIsotope_int")
public IIsotope getMajorIsotope(int atomicNumber) {
if (isotopes.get(PeriodicTable.getSymbol(atomicNumber)) == null) return null;
IIsotope major = null;
for (IIsotope isotope : isotopes.get(PeriodicTable.getSymbol(atomicNumber))) {
if (isotope.getAtomicNumber() == atomicNumber) {
Expand Down

0 comments on commit 0debacc

Please sign in to comment.