From cc33b3407777d6b69df1c1312eedcfa0c6b21b99 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Wed, 7 Dec 2016 13:13:46 +0000 Subject: [PATCH] JAL-2354 handle error response when fetching features --- src/jalview/ext/ensembl/EnsemblFeatures.java | 4 ++++ src/jalview/ext/ensembl/EnsemblSeqProxy.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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); } -- 1.7.10.2