SourceForge has been redesigned. Learn more.
Close

#1046 ChemObject.clone() throws NPE

cdk-1.2.x
closed
nobody
7
2012-11-03
2010-03-24
Goglepox
No

chemObject.clone() throws NPE when cloning object with null as value in the properties map.
chemObject.setProperty("key", null); // this works because lazyProperties() creates a HashMap also setProperties(Map) allow for any Map implementation
chemObject.clone(); this fails now because clone uses a Hashtable as the Map implementation which dose not allow null as value.

Discussion

  • Egon Willighagen

    Arvid, better to not catch the Exception, as it will mask where the NPE occurred. Applied to cdk-1.2.x.

     
  • Egon Willighagen

    Bug fix patch has been applied.