Indigo icon indicating copy to clipboard operation
Indigo copied to clipboard

Calling molecularWeight() on an invalid isotope kills the JVM when called from Java

Open dan2097 opened this issue 3 years ago • 2 comments

Indigo indigo = new Indigo();
IndigoObject mol = indigo.loadMolecule("[60C]");
double mw = mol.molecularWeight();
System.out.println(mw);

Crashes the JVM on v1.5.0 and v1.6.1 due to:

terminate called after throwing an instance of 'indigo::Element::Error'
  what():  element: getRelativeIsotopicMass: isotope (C, 60) not found

On v1.4.3 it gives acceptable behaviour:

Exception in thread "main" com.epam.indigo.IndigoException: element: getRelativeIsotopicMass: isotope (C, 60) not found
	at com.epam.indigo.Indigo.checkResultDouble(Indigo.java:119)
	at com.epam.indigo.IndigoObject.molecularWeight(IndigoObject.java:801)

dan2097 avatar Feb 02 '22 18:02 dan2097

Thanks for reporting this @dan2097, let me take a look at it

MysterionRise avatar Feb 02 '22 23:02 MysterionRise

Dear @dan2097, The issue is fixed. We'll deliver fixed version 1.6.2 during this weekend.

mkviatkovskii avatar Feb 17 '22 22:02 mkviatkovskii