JAL-4134 catch NPE - though in principle this should never happen…
authorJames Procter <j.procter@dundee.ac.uk>
Mon, 22 May 2023 14:35:12 +0000 (15:35 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Mon, 22 May 2023 14:35:12 +0000 (15:35 +0100)
src/jalview/analysis/AverageDistanceEngine.java

index 20b3e83..f4d69d5 100644 (file)
@@ -100,10 +100,13 @@ public class AverageDistanceEngine extends TreeEngine
 
       // compute distance matrix element
       ContactListI ith = cm.getContactList(i);
-
+      distances.setValue(i, i, 0);
+      if (ith==null)
+      {
+        continue;
+      }
       for (int j = 0; j < i; j++)
       {
-        distances.setValue(i, i, 0);
         ContactListI jth = cm.getContactList(j);
         if (jth == null)
         {