This fixes a problem with reporting a 'null' result from
a test in the case of a timeout.  The current output does not 
show the machine that cauased this problem.  This change catches the null
pointer and creates an exception with the remote client Id in the
message.

Patch by: zundel
Review by: scottb(TBR)


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@2660 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/junit/JUnitShell.java b/user/src/com/google/gwt/junit/JUnitShell.java
index c3ace51..5c98abc 100644
--- a/user/src/com/google/gwt/junit/JUnitShell.java
+++ b/user/src/com/google/gwt/junit/JUnitShell.java
@@ -575,19 +575,26 @@
     for (Entry<String, JUnitResult> entry : results.entrySet()) {
       String clientId = entry.getKey();
       JUnitResult result = entry.getValue();
-      Throwable exception = result.getException();
 
-      // In the case that we're running multiple clients at once, we need to
-      // let the user know the browser in which the failure happened
-      if (parallelTesting && exception != null) {
-        String msg = "Remote test failed at " + clientId;
-        if (exception instanceof AssertionFailedError) {
-          AssertionFailedError newException = new AssertionFailedError(msg
-              + "\n" + exception.getMessage());
-          newException.setStackTrace(exception.getStackTrace());
-          exception = newException;
-        } else {
-          exception = new RuntimeException(msg, exception);
+      Throwable exception = null;
+      if (result == null) {
+        String msg = "Remote test returned no result from: " + clientId;
+        exception = new RuntimeException();
+      } else {
+        exception = result.getException();
+
+        // In the case that we're running multiple clients at once, we need to
+        // let the user know the browser in which the failure happened
+        if (parallelTesting && exception != null) {
+          String msg = "Remote test failed at " + clientId;
+          if (exception instanceof AssertionFailedError) {
+            AssertionFailedError newException = new AssertionFailedError(msg
+                + "\n" + exception.getMessage());
+            newException.setStackTrace(exception.getStackTrace());
+            exception = newException;
+          } else {
+            exception = new RuntimeException(msg, exception);
+          }
         }
       }