Replaced image
[jalview.git] / src / jalview / io / FileLoader.java
index 7db0b90..0fc4aa8 100755 (executable)
@@ -125,7 +125,8 @@ public class FileLoader
 \r
     public void run()\r
     {\r
-      Desktop.instance.startLoading(file);\r
+      if (Desktop.instance != null)\r
+        Desktop.instance.startLoading(file);\r
 \r
       SequenceI[] sequences = null;\r
 \r
@@ -167,11 +168,6 @@ public class FileLoader
             Desktop.addInternalFrame(af, file, AlignFrame.NEW_WINDOW_WIDTH,\r
                                      AlignFrame.NEW_WINDOW_HEIGHT);\r
 \r
-            if(jalview.bin.Cache.getDefault("WRAP_ALIGNMENT", false))\r
-            {\r
-              af.wrapMenuItem.setSelected(true);\r
-              af.wrapMenuItem_actionPerformed(null);\r
-            }\r
             try\r
             {\r
               af.setMaximum(jalview.bin.Cache.getDefault("SHOW_FULLSCREEN", false));\r
@@ -180,10 +176,12 @@ public class FileLoader
             {\r
             }\r
           }\r
-\r
         }\r
         else\r
         {\r
+          if (Desktop.instance != null)\r
+            Desktop.instance.stopLoading();\r
+\r
           JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
                                                 "Couldn't load file " + file +\r
                                                 "\n"\r
@@ -198,7 +196,9 @@ public class FileLoader
         updateRecentlyOpened();\r
       }\r
 \r
-      Desktop.instance.stopLoading();\r
+      if (Desktop.instance != null)\r
+        Desktop.instance.stopLoading();\r
+\r
     }\r
   }\r
 \r