JAL-1115 trap exception arising from race condition when alignment edited during...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 14 Jun 2012 10:32:08 +0000 (11:32 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 14 Jun 2012 10:32:08 +0000 (11:32 +0100)
src/jalview/workers/ConservationThread.java

index 23d1773..194c389 100644 (file)
@@ -83,10 +83,16 @@ public class ConservationThread extends AlignCalcWorker implements AlignCalcWork
 
         return;
       }
-
+      try {
       cons = Conservation.calculateConservation("All",
               jalview.schemes.ResidueProperties.propHash, 3,
               alignment.getSequences(), 0, alWidth - 1, false, ConsPercGaps, quality!=null);
+      } catch (IndexOutOfBoundsException x)
+      {
+        // probable race condition. just finish and return without any fuss.
+        calcMan.workerComplete(this);
+        return;
+      }
       updateResultAnnotation(true);
     } catch (OutOfMemoryError error)
     {