changeset 80:8f4d653aeb0e

fix NullPointerException in debug output 2011-01-04 Omair Majid <omajid@redhat.com> * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (installShutdownHooks): Only print when not null.
author Omair Majid <omajid@redhat.com>
date Tue, 04 Jan 2011 15:26:11 -0500
parents 4afa92b88e74
children b3647620fa41
files ChangeLog netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Dec 24 15:17:35 2010 -0500
+++ b/ChangeLog	Tue Jan 04 15:26:11 2011 -0500
@@ -1,3 +1,8 @@
+2011-01-04  Omair Majid  <omajid@redhat.com>
+
+	* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+	(installShutdownHooks): Only print when not null.
+
 2010-12-24  Omair Majid  <omajid@redhat.com>
 
 	* netx/net/sourceforge/jnlp/security/SecurityWarning.java
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Fri Dec 24 15:17:35 2010 -0500
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Tue Jan 04 15:26:11 2011 -0500
@@ -182,16 +182,15 @@
         Runtime.getRuntime().addShutdownHook(new Thread() {
             @Override
             public void run() {
-                if (JNLPRuntime.isDebug()) {
-                    System.out.println("Cleaning up native directory" + nativeDir.getAbsolutePath());
-                }
-
                 /*
                  * Delete only the native dir created by this classloader (if
                  * there is one). Other classloaders (parent, peers) will all
                  * cleanup things they created
                  */
                 if (nativeDir != null) {
+                    if (JNLPRuntime.isDebug()) {
+                        System.out.println("Cleaning up native directory" + nativeDir.getAbsolutePath());
+                    }
                     try {
                         FileUtils.recursiveDelete(nativeDir,
                                 new File(System.getProperty("java.io.tmpdir")));