Don't exit if file not found and not headless
authoramwaterhouse <Andrew Waterhouse>
Fri, 7 Oct 2005 10:20:49 +0000 (10:20 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 7 Oct 2005 10:20:49 +0000 (10:20 +0000)
src/jalview/bin/Jalview.java

index 910c947..2899abb 100755 (executable)
@@ -78,8 +78,9 @@ public class Jalview
 \r
 \r
           if (aparser.contains("nodisplay"))\r
+          {\r
             System.setProperty("java.awt.headless", "true");\r
-\r
+          }\r
           if (System.getProperty("java.awt.headless") != null\r
               && System.getProperty("java.awt.headless").equals("true"))\r
           {\r
@@ -145,7 +146,8 @@ public class Jalview
               if (! (new java.io.File(file)).exists())\r
               {\r
                 System.out.println("Can't find " + file);\r
-                System.exit(1);\r
+                if(headless)\r
+                  System.exit(1);\r
               }\r
             }\r
 \r
@@ -238,10 +240,6 @@ public class Jalview
               desktop.LoadFile(file, protocol, format);\r
             }\r
           }\r
-\r
-\r
-          if (desktop==null)\r
-            System.exit(0);\r
     }\r
 }\r
 \r