JAL-2755 correct Javadoc and error handling
[jalview.git] / src / jalview / ext / ensembl / EnsemblLookup.java
index 5f353f8..82690a3 100644 (file)
@@ -131,7 +131,7 @@ public class EnsemblLookup extends EnsemblRestClient
 
   /**
    * Returns the gene id related to the given identifier (which may be for a
-   * gene, transcript or protein)
+   * gene, transcript or protein), or null if none is found
    * 
    * @param identifier
    * @return
@@ -143,7 +143,7 @@ public class EnsemblLookup extends EnsemblRestClient
 
   /**
    * Returns the gene id related to the given identifier (which may be for a
-   * gene, transcript or protein)
+   * gene, transcript or protein), or null if none is found
    * 
    * @param identifier
    * @param objectType
@@ -165,6 +165,10 @@ public class EnsemblLookup extends EnsemblRestClient
    */
   protected String parseGeneId(JSONObject val)
   {
+    if (val == null)
+    {
+      return null;
+    }
     String geneId = null;
     String type = val.get(OBJECT_TYPE).toString();
     if (OBJECT_TYPE_GENE.equalsIgnoreCase(type))