JAL-1270 Desktop.instance is null during headless jalview tests
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Wed, 25 Sep 2013 15:10:43 +0000 (16:10 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Wed, 25 Sep 2013 15:11:11 +0000 (16:11 +0100)
src/jalview/gui/Desktop.java

index 877aebb..322365c 100644 (file)
@@ -647,8 +647,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     // A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
     // IF JALVIEW IS RUNNING HEADLESS
     // ///////////////////////////////////////////////
-    if (System.getProperty("java.awt.headless") != null
-            && System.getProperty("java.awt.headless").equals("true"))
+    if (instance == null || (System.getProperty("java.awt.headless") != null
+            && System.getProperty("java.awt.headless").equals("true")))
     {
       return;
     }