From 72da885aa401e932e73af4a554ea338cd5015efc Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 6 Oct 2016 08:52:55 +0100 Subject: [PATCH] JAL-2245 checks for null added (in case EMBL fetch finds nothing) --- src/jalview/datamodel/xdb/embl/EmblFile.java | 4 ++++ src/jalview/ws/dbsources/EmblXmlSource.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jalview/datamodel/xdb/embl/EmblFile.java b/src/jalview/datamodel/xdb/embl/EmblFile.java index 69870b6..a95f6e5 100644 --- a/src/jalview/datamodel/xdb/embl/EmblFile.java +++ b/src/jalview/datamodel/xdb/embl/EmblFile.java @@ -152,6 +152,10 @@ public class EmblFile */ static void canonicaliseDbRefs(EmblFile record) { + if (record.getEntries() == null) + { + return; + } for (EmblEntry entry : record.getEntries()) { if (entry.getDbRefs() != null) diff --git a/src/jalview/ws/dbsources/EmblXmlSource.java b/src/jalview/ws/dbsources/EmblXmlSource.java index 2049766..f672e8b 100644 --- a/src/jalview/ws/dbsources/EmblXmlSource.java +++ b/src/jalview/ws/dbsources/EmblXmlSource.java @@ -103,7 +103,7 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy } List peptides = new ArrayList(); - if (efile != null) + if (efile != null && efile.getEntries() != null) { for (EmblEntry entry : efile.getEntries()) { -- 1.7.10.2