JAL-3878 Handle nulls when filtering annotation workers by name.
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Tue, 23 Nov 2021 15:31:12 +0000 (16:31 +0100)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Tue, 23 Nov 2021 15:31:12 +0000 (16:31 +0100)
src/jalview/workers/AlignCalcManager2.java

index 5c25668..e4574d3 100644 (file)
@@ -317,7 +317,7 @@ public class AlignCalcManager2 implements AlignCalcManagerI2
     List<AlignCalcWorkerI> collected = new ArrayList<>();
     for (var worker : getWorkers())
     {
-      if (worker.getCalcName().equals(name))
+      if (worker.getCalcName() != null && worker.getCalcName().equals(name))
       {
         collected.add(worker);
       }
@@ -371,7 +371,7 @@ public class AlignCalcManager2 implements AlignCalcManagerI2
     {
       for (var worker : getWorkers())
       {
-        if (worker.getCalcName().equals(name))
+        if (worker.getCalcName() != null && worker.getCalcName().equals(name))
         {
           removeWorker(worker);
         }