Skip to content

Commit a9bc131

Browse files
committed
Resolve #523 4 test zero length before access
1 parent 63231f6 commit a9bc131

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

descriptor/qsarbond/src/main/java/org/openscience/cdk/qsar/descriptors/bond/BondSigmaElectronegativityDescriptor.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,12 @@ public DescriptorSpecification getSpecification() {
8888
*/
8989
@Override
9090
public void setParameters(Object[] params) throws CDKException {
91-
if (params.length > 1) {
91+
if (params.length > 1)
9292
throw new CDKException("SigmaElectronegativityDescriptor only expects one parameter");
93-
}
94-
if (!(params[0] instanceof Integer)) {
93+
if (params.length == 0)
94+
return;
95+
if (!(params[0] instanceof Integer))
9596
throw new CDKException("The parameter must be of type Integer");
96-
}
97-
if (params.length == 0) return;
9897
maxIterations = (Integer) params[0];
9998
}
10099

0 commit comments

Comments
 (0)