JAL-2210 patch for when no DBRefs on sequence
authorJim Procter <jprocter@issues.jalview.org>
Wed, 28 Sep 2016 14:20:46 +0000 (15:20 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 28 Sep 2016 14:20:46 +0000 (15:20 +0100)
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)