Desktop is null if -noDisplay is set
authoramwaterhouse <Andrew Waterhouse>
Fri, 11 Aug 2006 08:39:21 +0000 (08:39 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 11 Aug 2006 08:39:21 +0000 (08:39 +0000)
src/jalview/io/FileLoader.java

index 77f2a79..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
@@ -178,7 +179,8 @@ public class FileLoader
         }\r
         else\r
         {\r
-          Desktop.instance.stopLoading();\r
+          if (Desktop.instance != null)\r
+            Desktop.instance.stopLoading();\r
 \r
           JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
                                                 "Couldn't load file " + file +\r
@@ -194,7 +196,8 @@ public class FileLoader
         updateRecentlyOpened();\r
       }\r
 \r
-      Desktop.instance.stopLoading();\r
+      if (Desktop.instance != null)\r
+        Desktop.instance.stopLoading();\r
 \r
     }\r
   }\r