JAL-1632 correct i18n and NPE
[jalview.git] / src / jalview / gui / CalculationChooser.java
index 6f5510c..8a95594 100644 (file)
@@ -25,6 +25,7 @@ import jalview.analysis.scoremodels.ScoreModels;
 import jalview.analysis.scoremodels.SimilarityParams;
 import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.SimilarityParamsI;
+import jalview.datamodel.SequenceGroup;
 import jalview.util.MessageManager;
 
 import java.awt.BorderLayout;
@@ -269,9 +270,7 @@ public class CalculationChooser extends JPanel
       title = title + " (" + af.getViewport().viewName + ")";
     }
 
-    Desktop.addInternalFrame(frame,
-            title, width,
-            height, false);
+    Desktop.addInternalFrame(frame, title, width, height, false);
     calcChoicePanel.doLayout();
     revalidate();
     /*
@@ -488,7 +487,8 @@ public class CalculationChooser extends JPanel
      * this check in in case this method gets exposed programmatically in future
      */
     AlignViewport viewport = af.getViewport();
-    if (viewport.getSelectionGroup().getSize() < MIN_TREE_SELECTION)
+    SequenceGroup sg = viewport.getSelectionGroup();
+    if (sg != null && sg.getSize() < MIN_TREE_SELECTION)
     {
       JvOptionPane
               .showMessageDialog(