Author: toad
Date: 2006-03-28 18:11:19 +0000 (Tue, 28 Mar 2006)
New Revision: 8342

Modified:
   trunk/apps/installer/src/Sha1Test.java
Log:
fix the NullPointerException.


Modified: trunk/apps/installer/src/Sha1Test.java
===================================================================
--- trunk/apps/installer/src/Sha1Test.java      2006-03-28 17:01:44 UTC (rev 
8341)
+++ trunk/apps/installer/src/Sha1Test.java      2006-03-28 18:11:19 UTC (rev 
8342)
@@ -13,13 +13,17 @@
                if(URI2 == null) System.exit(2);

                String filename = (new File(URI2)).getName();
+               System.out.println("Fetching "+filename);

                while(count<3){
+                       if(count>0)
+                               System.out.println("Attempt "+count);
                        try{
                                get(URI2+".sha1", filename+".sha1");
                                if(sha1test(filename)) System.exit(0);
                                get(URI2, filename);
                        }catch(FileNotFoundException e){
+                               System.out.println("Not found, ignoring");
                        }
                        count++;
                        try{
@@ -114,7 +118,7 @@
                        System.out.println(ioe);
                } finally {
                        try {
-                               is.close();
+                               if(is != null) is.close();
                        } catch (IOException ioe) {
                        }
                }


Reply via email to