JAL-1191 refined warning message
[jalview.git] / src / jalview / util / DBRefUtils.java
index 2d09088..d43f5bc 100755 (executable)
@@ -618,21 +618,21 @@ public class DBRefUtils
    * sequences if they have an appropriate primary ref
    * <table>
    * <tr>
-   * <td>Seq Type</td>
-   * <td>Primary DB</td>
-   * <td>Direct which will be promoted</td>
+   * <th>Seq Type</th>
+   * <th>Primary DB</th>
+   * <th>Direct which will be promoted</th>
    * </tr>
-   * <tr>
+   * <tr align=center>
    * <td>peptides</td>
    * <td>Ensembl</td>
    * <td>Uniprot</td>
    * </tr>
-   * <tr>
+   * <tr align=center>
    * <td>peptides</td>
    * <td>Ensembl</td>
    * <td>Uniprot</td>
    * </tr>
-   * <tr>
+   * <tr align=center>
    * <td>dna</td>
    * <td>Ensembl</td>
    * <td>ENA</td>
@@ -650,8 +650,16 @@ public class DBRefUtils
       return;
     }
     List<DBRefEntry> selfs = new ArrayList<DBRefEntry>();
-    selfs.addAll(Arrays.asList(selectDbRefs(!sequence.isProtein(),
-            sequence.getDBRefs())));
+    {
+      DBRefEntry[] selfArray = selectDbRefs(!sequence.isProtein(),
+              sequence.getDBRefs());
+      if (selfArray == null || selfArray.length == 0)
+      {
+        // nothing to do
+        return;
+      }
+      selfs.addAll(Arrays.asList(selfArray));
+    }
 
     // filter non-primary refs
     for (DBRefEntry p : pr)