bugfix to safely deal with server exception resulting in null document
authorjprocter <Jim Procter>
Wed, 12 Nov 2008 11:10:50 +0000 (11:10 +0000)
committerjprocter <Jim Procter>
Wed, 12 Nov 2008 11:10:50 +0000 (11:10 +0000)
src/jalview/ws/ebi/EBIFetchClient.java

index d5ab2e1..2a13baa 100644 (file)
@@ -124,6 +124,10 @@ public class EBIFetchClient
     String[] data = fetchData(ids, f, s);\r
     // TODO: after JV 2.4 - test data==null and pass error(s) back up if\r
     // possible (OutOfMemoryErrors are usual problem)\r
+    if (data==null)\r
+    {\r
+      return null;\r
+    }\r
     File outFile = null;\r
     try\r
     {\r
@@ -137,7 +141,8 @@ public class EBIFetchClient
         index++;\r
       }\r
       out.close();\r
-    } catch (Exception ex)\r
+    }\r
+    catch (Exception ex)\r
     {\r
     }\r
     return outFile;\r