JAL-2210 patch for when no DBRefs on sequence
[jalview.git] / src / jalview / util / DBRefUtils.java
index 2d09088..757fc4d 100755 (executable)
@@ -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)