JAL-674 patch NPE bug when test run in isolation
authorJim Procter <jprocter@dundee.ac.uk>
Thu, 27 Nov 2014 10:35:58 +0000 (10:35 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Thu, 27 Nov 2014 10:35:58 +0000 (10:35 +0000)
test/jalview/io/Jalview2xmlTests.java

index 32aa84a..fec7d75 100644 (file)
@@ -237,7 +237,8 @@ public class Jalview2xmlTests
   @Test
   public void gatherViewsHere() throws Exception
   {
-    int origCount = Desktop.getAlignframes().length;
+    int origCount = Desktop.getAlignframes() == null ? 0 : Desktop
+            .getAlignframes().length;
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
             "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);