From d2defd0ed16a1d013296854a3030e54e838b7a0c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sun, 27 Apr 2014 18:44:12 +0100 Subject: [PATCH] workaround for JAL-1319 - catch unexpected NPE thrown by JABA client method --- src/jalview/ws/jws2/AADisorderClient.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/jalview/ws/jws2/AADisorderClient.java b/src/jalview/ws/jws2/AADisorderClient.java index 49a904c..e158da7 100644 --- a/src/jalview/ws/jws2/AADisorderClient.java +++ b/src/jalview/ws/jws2/AADisorderClient.java @@ -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) { -- 1.7.10.2