JAL-2344 handle null format, simplify JalviewFileChooser constructor
[jalview.git] / src / jalview / gui / AlignFrame.java
index 8ca9085..9c4ff81 100644 (file)
@@ -1112,11 +1112,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void saveAs_actionPerformed(ActionEvent e)
   {
+    String format = currentFileFormat == null ? null : currentFileFormat
+            .toString();
     JalviewFileChooser chooser = JalviewFileChooser.forWrite(
-            Cache.getProperty("LAST_DIRECTORY"),
-            // AppletFormatAdapter.WRITABLE_EXTENSIONS,
-            // AppletFormatAdapter.WRITABLE_FNAMES,
-            currentFileFormat.toString(), false);
+            Cache.getProperty("LAST_DIRECTORY"), format);
 
     chooser.setFileView(new JalviewFileView());
     chooser.setDialogTitle(MessageManager