workaround for JAL-1319 - catch unexpected NPE thrown by JABA client method
authorJim Procter <jprocter@dundee.ac.uk>
Sun, 27 Apr 2014 17:44:12 +0000 (18:44 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Sun, 27 Apr 2014 17:44:12 +0000 (18:44 +0100)
src/jalview/ws/jws2/AADisorderClient.java

index 49a904c..e158da7 100644 (file)
@@ -19,8 +19,8 @@
 package jalview.ws.jws2;
 
 import jalview.api.AlignCalcWorkerI;
+import jalview.bin.Cache;
 import jalview.datamodel.AlignmentAnnotation;
-
 import jalview.datamodel.GraphLine;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
@@ -37,6 +37,7 @@ import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+
 import compbio.data.sequence.Range;
 import compbio.data.sequence.Score;
 import compbio.data.sequence.ScoreManager.ScoreHolder;
@@ -206,8 +207,18 @@ public class AADisorderClient extends JabawsCalcWorker implements
         {
           seq = seq.getDatasetSequence();
         }
-        ;
-        ScoreHolder scores = scoremanager.getAnnotationForSequence(seqId);
+        ScoreHolder scores = null;
+        try {
+          scores = scoremanager.getAnnotationForSequence(seqId);
+        } catch (Exception q)
+        {
+          Cache.log
+                  .info("Couldn't recover disorder prediction for sequence "
+                          + seq.getName()
+                          + "(Prediction name was "
+                          + seqId+")"
+                          + "\nSee http://issues.jalview.org/browse/JAL-1319 for one possible reason why disorder predictions might fail.");
+        }
         float last = Float.NaN, val = Float.NaN;
         int lastAnnot = ourAnnot.size();
         if (scores!=null && scores.scores!=null) {