From: jprocter Date: Tue, 28 Aug 2012 13:06:03 +0000 (+0100) Subject: JAL-1136 sometimes there are no parameters associated with a CalcId key X-Git-Tag: Jalview_2_9~390 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9f7269a91e9d2fd7992c11939aa797446783ce61;p=jalview.git JAL-1136 sometimes there are no parameters associated with a CalcId key --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 6acd421..ee67b55 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -1236,12 +1236,18 @@ public class Jalview2XML } } } - if (calcIdSet.size()>0) + if (calcIdSet.size() > 0) { - for (String calcId:calcIdSet) + for (String calcId : calcIdSet) { - if (calcId.trim().length()>0) { - view.addCalcIdParam(createCalcIdParam(calcId, av)); + if (calcId.trim().length() > 0) + { + CalcIdParam cidp = createCalcIdParam(calcId, av); + // Some calcIds have no parameters. + if (cidp != null) + { + view.addCalcIdParam(cidp); + } } } } @@ -3363,13 +3369,20 @@ public class Jalview2XML ); } } - if (view.getCalcIdParam()!=null) + if (view.getCalcIdParam() != null) { - for (CalcIdParam calcIdParam:view.getCalcIdParam()) + for (CalcIdParam calcIdParam : view.getCalcIdParam()) { - if (recoverCalcIdParam(calcIdParam, af.viewport)) { - } else { - warn("Couldn't recover parameters for "+calcIdParam.getCalcId()); + if (calcIdParam != null) + { + if (recoverCalcIdParam(calcIdParam, af.viewport)) + { + } + else + { + warn("Couldn't recover parameters for " + + calcIdParam.getCalcId()); + } } } }