JAL-1478 Fixed ArrayIndexOutOfBoundsException while performing NW mapping
[jalview.git] / src / MCview / PDBChain.java
index e4e619c..7fdf11b 100755 (executable)
@@ -147,6 +147,10 @@ public class PDBChain
 
       if (as.astr1.charAt(i) == as.astr2.charAt(i))
       {
+        if (pdbpos >= residues.size())
+        {
+          continue;
+        }
         Residue res = residues.elementAt(pdbpos);
         for (Atom atom : res.atoms)
         {
@@ -353,7 +357,7 @@ public class PDBChain
       Residue tmpres = residues.lastElement();
       Atom tmpat = tmpres.atoms.get(0);
       // Make A new SequenceFeature for the current residue numbering
-        SequenceFeature sf = new SequenceFeature("RES NUM", tmpat.resName
+        SequenceFeature sf = new SequenceFeature("RESNUM", tmpat.resName
               + ":" + tmpat.resNumIns + " " + pdbid + id, "", offset
               + count, offset + count, pdbid);
       // MCview.PDBChain.PDBFILEFEATURE);