JAL-3954 Do not retrieve alignment for failed jobs
[jalview.git] / src / jalview / ws2 / actions / hmmer / PhmmerTask.java
index e077b61..8a7a826 100644 (file)
@@ -61,8 +61,11 @@ class PhmmerTask extends AbstractPollableTask<BaseJob, AlignmentI>
   protected AlignmentI done() throws IOException
   {
     var job = getSubJobs().get(0);
+    var status = job.getStatus();
     Console.info(String.format("phmmer finished job \"%s\" with status %s",
-            job.getServerJob().getJobId(), job.getStatus()));
+            job.getServerJob().getJobId(), status));
+    if (status != JobStatus.COMPLETED)
+      return null;
     var outputAlignment = client.getAlignment(job.getServerJob());
     var querySeq = job.getInputSequences().get(0).deriveSequence();
     {