From: James Procter Date: Mon, 22 May 2023 14:35:12 +0000 (+0100) Subject: JAL-4134 catch NPE - though in principle this should never happen… X-Git-Tag: Release_2_11_3_0~14^2~3^2^2~18 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cd5f5840fc9dbf8edc58b010ab1caae9a695c5fe;p=jalview.git JAL-4134 catch NPE - though in principle this should never happen… --- diff --git a/src/jalview/analysis/AverageDistanceEngine.java b/src/jalview/analysis/AverageDistanceEngine.java index 20b3e83..f4d69d5 100644 --- a/src/jalview/analysis/AverageDistanceEngine.java +++ b/src/jalview/analysis/AverageDistanceEngine.java @@ -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) {