From: gmungoc Date: Wed, 7 Dec 2016 13:13:46 +0000 (+0000) Subject: JAL-2354 handle error response when fetching features X-Git-Tag: Release_2_10_3b1~391 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cc33b3407777d6b69df1c1312eedcfa0c6b21b99;p=jalview.git JAL-2354 handle error response when fetching features --- diff --git a/src/jalview/ext/ensembl/EnsemblFeatures.java b/src/jalview/ext/ensembl/EnsemblFeatures.java index b28a37f..7570822 100644 --- a/src/jalview/ext/ensembl/EnsemblFeatures.java +++ b/src/jalview/ext/ensembl/EnsemblFeatures.java @@ -85,6 +85,10 @@ class EnsemblFeatures extends EnsemblRestClient List queries = new ArrayList(); queries.add(query); FileParse fp = getSequenceReader(queries); + if (fp == null || !fp.isValid()) + { + return null; + } FeaturesFile fr = new FeaturesFile(fp); return new Alignment(fr.getSeqsAsArray()); } diff --git a/src/jalview/ext/ensembl/EnsemblSeqProxy.java b/src/jalview/ext/ensembl/EnsemblSeqProxy.java index 7aa7178..732bc0f 100644 --- a/src/jalview/ext/ensembl/EnsemblSeqProxy.java +++ b/src/jalview/ext/ensembl/EnsemblSeqProxy.java @@ -233,7 +233,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient EnsemblFeatureType[] features = getFeaturesToFetch(); AlignmentI geneFeatures = gffFetcher.getSequenceRecords(accId, features); - if (geneFeatures.getHeight() > 0) + if (geneFeatures != null && geneFeatures.getHeight() > 0) { genomicSequence = geneFeatures.getSequenceAt(0); }