JAL-3763 Javadoc, check for null, additional tests
[jalview.git] / src / jalview / gui / PopupMenu.java
index 2a7fb9f..2f77959 100644 (file)
@@ -838,8 +838,13 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
        * show local rather than linked feature coordinates
        */
       int[] beginRange = mf.getMappedPositions(start, start);
-      start = beginRange[0];
       int[] endRange = mf.getMappedPositions(end, end);
+      if (beginRange == null || endRange == null)
+      {
+        // e.g. variant extending to stop codon so not mappable
+        return;
+      }
+      start = beginRange[0];
       end = endRange[endRange.length - 1];
     }
     StringBuilder desc = new StringBuilder();