From cd5f5840fc9dbf8edc58b010ab1caae9a695c5fe Mon Sep 17 00:00:00 2001 From: James Procter Date: Mon, 22 May 2023 15:35:12 +0100 Subject: [PATCH] =?utf8?q?JAL-4134=20catch=20NPE=20-=20though=20in=20princip?= =?utf8?q?le=20this=20should=20never=20happen=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/analysis/AverageDistanceEngine.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) { -- 1.7.10.2