Skip to content

Commit

Permalink
Fixed stupid code: completeReturn() does not return in the method :( …
Browse files Browse the repository at this point in the history
…Thanx to Ola for spotting it
  • Loading branch information
egonw committed May 20, 2010
1 parent 1b2a534 commit 551fbf1
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -49,7 +49,10 @@ public void generate( IMolecule molecule,
throws Exception {
monitor.beginTask("Calculating InChI", IProgressMonitor.UNKNOWN);
// return early if InChI library could not be loaded
if (!isAvailable()) returner.completeReturn(InChI.FAILED_TO_CALCULATE);
if (!isAvailable()) {
returner.completeReturn(InChI.FAILED_TO_CALCULATE);
return;
}

Object adapted = molecule.getAdapter(IAtomContainer.class);
if (adapted != null) {
Expand All @@ -60,10 +63,6 @@ public void generate( IMolecule molecule,
atom.setFlag(CDKConstants.ISAROMATIC, false);
for (IBond bond : clone.bonds())
bond.setFlag(CDKConstants.ISAROMATIC, false);
// FIXME: this should already have been covered by the earlier
// isAvailable() call, but wasn't... weird...
if (factory == null)
returner.completeReturn(InChI.FAILED_TO_CALCULATE);
InChIGenerator gen = factory.getInChIGenerator(clone);
INCHI_RET status = gen.getReturnStatus();
if(monitor.isCanceled())
Expand Down

0 comments on commit 551fbf1

Please sign in to comment.