JAL-2344 use ".cif" for saved mmCIF file (and refactor fetch as file)
[jalview.git] / src / jalview / ws / dbsources / EmblXmlSource.java
index 2049766..b2fb808 100644 (file)
@@ -64,7 +64,7 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
     {
       reply = dbFetch.fetchDataAsFile(
               emprefx.toLowerCase() + ":" + query.trim(), "display=xml",
-              ".xml");
+              "xml");
     } catch (Exception e)
     {
       stopQuery();
@@ -102,8 +102,13 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
       }
     }
 
+    /*
+     * invalid accession gets a reply with no <entry> elements, text content of
+     * EmbFile reads something like (e.g.) this ungrammatical phrase
+     * Entry: <acc> display type is either not supported or entry is not found.
+     */
     List<SequenceI> peptides = new ArrayList<SequenceI>();
-    if (efile != null)
+    if (efile != null && efile.getEntries() != null)
     {
       for (EmblEntry entry : efile.getEntries())
       {