Permalink
Browse files

Fixed potential NPE.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information...
1 parent 45b67e5 commit 280381d3ea98f13d54eb3297f69567eda5964ca2 @dmak dmak committed with egonw Jan 14, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/main/org/openscience/cdk/libio/cml/QSARCustomizer.java
@@ -31,9 +31,6 @@
import java.util.Iterator;
import java.util.Map;
-import nu.xom.Attribute;
-import nu.xom.Element;
-
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
@@ -54,6 +51,9 @@
import org.xmlcml.cml.element.CMLPropertyList;
import org.xmlcml.cml.element.CMLScalar;
+import nu.xom.Attribute;
+import nu.xom.Element;
+
/**
* Customizer for the libio-cml Convertor to be able to export details for
* QSAR descriptors calculated for Molecules.
@@ -118,6 +118,7 @@ private Element createScalar(IDescriptorResult value) {
scalar.appendChild(buffer.toString());
} else {
// logger.error("Could not convert this object to a scalar element: ", value);
+ scalar = new CMLScalar();
scalar.appendChild(value.toString());
}
return scalar;

0 comments on commit 280381d

Please sign in to comment.