Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #181 from cdk/patch/atomtype-missing-valency
Only set electron valency if the pi bond count and formal neighbour c…
  • Loading branch information
egonw committed Nov 28, 2015
2 parents f68b211 + 565530e commit bb2950b
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -75,7 +75,12 @@ final class ImmutableAtomType implements IAtomType {
if (type.getValency() != null) {
this.electronValency = type.getValency();
} else {
this.electronValency = type.getProperty(CDKConstants.PI_BOND_COUNT, Integer.class) + type.getFormalNeighbourCount();
Integer piBondCount = type.getProperty(CDKConstants.PI_BOND_COUNT, Integer.class);
if (piBondCount != null && formalNeighbourCount != null) {
this.electronValency = piBondCount + formalNeighbourCount;
} else {
this.electronValency = null;
}
}
}

Expand Down

0 comments on commit bb2950b

Please sign in to comment.