From: Jim Procter Date: Wed, 28 Sep 2016 14:20:46 +0000 (+0100) Subject: JAL-2210 patch for when no DBRefs on sequence X-Git-Tag: Release_2_10_0~20^2~30 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=08f51db72b37addca7babd1582bfe5c6eaab2f2c;p=jalview.git JAL-2210 patch for when no DBRefs on sequence --- diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index 2d09088..757fc4d 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -650,8 +650,16 @@ public class DBRefUtils return; } List selfs = new ArrayList(); - 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)