JAL-4307 some models return null for hetatm list
authorJames Procter <j.procter@dundee.ac.uk>
Fri, 20 Oct 2023 12:56:01 +0000 (13:56 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Fri, 20 Oct 2023 12:56:01 +0000 (13:56 +0100)
src/jalview/ext/jmol/JalviewJmolBinding.java

index c8ce3cd..5b931e1 100644 (file)
@@ -43,8 +43,6 @@ import org.jmol.api.JmolViewer;
 import org.jmol.c.CBK;
 import org.jmol.viewer.Viewer;
 
-import com.google.common.collect.Lists;
-
 import jalview.api.AlignmentViewPanel;
 import jalview.api.FeatureRenderer;
 import jalview.api.FeatureSettingsModelI;
@@ -200,7 +198,10 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
     for (int mc=0;mc<jmolViewer.ms.mc; mc++)
     {
       Map<String,String> hets = jmolViewer.ms.getHeteroList(mc);
-      hetlist.putAll(hets);
+      if (hets!=null)
+      {
+        hetlist.putAll(hets);
+      }
     }
     return Arrays.asList(hetlist.keySet().toArray(new String[0]));
   }