JAL-2349 allow PAE or other contact matrices to hold a coordinate mapping allowing...
[jalview.git] / src / jalview / analysis / AverageDistanceEngine.java
index e6a763b..c52c7be 100644 (file)
@@ -105,6 +105,10 @@ public class AverageDistanceEngine extends TreeEngine
       {
         distances.setValue(i, i, 0);
         ContactListI jth = cm.getContactList(j);
+        if (jth==null)
+        {
+          break;
+        }
         double prd = 0;
         for (int indx = 0; indx < cm.getHeight(); indx++)
         {