JAL-3032 don't throw Exception to signal chain not found, return null
[jalview.git] / src / jalview / ext / jmol / JmolParser.java
index 542b2bc..a9c5f5c 100644 (file)
@@ -172,16 +172,16 @@ public class JmolParser extends StructureFile implements JmolStatusListener
       List<Atom> significantAtoms = convertSignificantAtoms(ms);
       for (Atom tmpatom : significantAtoms)
       {
-        try
+        if (tmpatom.resNumIns.trim().equals(lastID))
+        {
+          // phosphorylated protein - seen both CA and P..
+          continue;
+        }
+        tmpchain = findChain(tmpatom.chain);
+        if (tmpchain != null)
         {
-          tmpchain = findChain(tmpatom.chain);
-          if (tmpatom.resNumIns.trim().equals(lastID))
-          {
-            // phosphorylated protein - seen both CA and P..
-            continue;
-          }
           tmpchain.atoms.addElement(tmpatom);
-        } catch (Exception e)
+        } else
         {
           tmpchain = new PDBChain(getId(), tmpatom.chain);
           getChains().add(tmpchain);