Navigation Menu

Skip to content

Commit

Permalink
Return a default array instead of null, fixing NullPointerExceptions …
Browse files Browse the repository at this point in the history
…caused otherwise when instantiating via e.g. IAtom(Elements.CARBON)

Change-Id: I2d424d184f0ab96216ece84bc8768bc586d8da4b
Signed-off-by: ngn <jeliazkova.nina@gmail.com>
  • Loading branch information
egonw committed May 20, 2012
1 parent 53aa18c commit 19bb74a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/org/openscience/cdk/config/NaturalElement.java
Expand Up @@ -24,6 +24,7 @@

import java.util.Map;

import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IChemObjectChangeEvent;
import org.openscience.cdk.interfaces.IChemObjectListener;
Expand Down Expand Up @@ -69,7 +70,7 @@ protected NaturalElement(String element, Integer atomicNumber) {
@Override public boolean getFlag(int flag_type) { return false; }
@Override public void setProperties(Map<Object, Object> properties) {}
@Override public void setFlags(boolean[] flagsNew) {}
@Override public boolean[] getFlags() { return null; }
@Override public boolean[] getFlags() { return new boolean[CDKConstants.MAX_FLAG_INDEX + 1]; }
@Override public IChemObjectBuilder getBuilder() { return null; }
@Override public void setAtomicNumber(Integer atomicNumber) {}
@Override public void setSymbol(String symbol) {}
Expand Down

0 comments on commit 19bb74a

Please sign in to comment.