Remove all gaps must check jSize
[jalview.git] / src / jalview / gui / PopupMenu.java
index 5ff9ad9..705d407 100755 (executable)
@@ -434,13 +434,15 @@ public class PopupMenu extends JPopupMenu
     void refresh()\r
     {\r
         SequenceGroup sg = getGroup();\r
-        SuperGroup superG = ap.av.alignment.getSuperGroup(sg);\r
-\r
-        if (superG != null)\r
+        if(sg!=null)\r
         {\r
+          SuperGroup superG = ap.av.alignment.getSuperGroup(sg);\r
+\r
+          if (superG != null)\r
+          {\r
             superG.setSuperGroupProperties(sg);\r
+          }\r
         }\r
-\r
         ap.seqPanel.repaint();\r
     }\r
 \r
@@ -724,9 +726,9 @@ public class PopupMenu extends JPopupMenu
     SequenceGroup getGroup()\r
     {\r
         SequenceGroup sg = ap.av.getSelectionGroup();\r
-\r
-        // this method won't add a new group if it already exists\r
-        ap.av.alignment.addGroup(sg);\r
+      // this method won't add a new group if it already exists\r
+        if(sg!=null)\r
+          ap.av.alignment.addGroup(sg);\r
 \r
         return sg;\r
     }\r