From: Jim Procter Date: Sun, 27 Apr 2014 17:44:12 +0000 (+0100) Subject: workaround for JAL-1319 - catch unexpected NPE thrown by JABA client method X-Git-Tag: Jalview_2_9~194^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d2defd0ed16a1d013296854a3030e54e838b7a0c;p=jalview.git workaround for JAL-1319 - catch unexpected NPE thrown by JABA client method --- 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) {