changeset 29:df3cf32781d3

Fixed PR542 Plugin fails with NPE on http://www.openprocessing.org/visuals/iframe.php?visualID=2615
author Deepak Bhole <dbhole@redhat.com>
date Mon, 01 Nov 2010 11:41:59 -0700
parents bdab3d4ac170
children 6c2527d42900
files ChangeLog NEWS netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
diffstat 3 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Nov 01 10:51:43 2010 -0700
+++ b/ChangeLog	Mon Nov 01 11:41:59 2010 -0700
@@ -1,3 +1,12 @@
+2010-11-01  Deepak Bhole <dbhole@redhat.com>
+
+	PR542: Plugin fails with NPE on
+	http://www.openprocessing.org/visuals/iframe.php?visualID=2615
+	* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+	(initializeResources): If cacheFile is null (JAR couldn't be downloaded),
+	try to continue, rather than allowing the exception to cause an abort.
+	* NEWS: Updated.
+
 2010-11-01  Deepak Bhole <dbhole@redhat.com>
 
 	* plugin/docs: Added new docs folder that contains plugin documentation.
--- a/NEWS	Mon Nov 01 10:51:43 2010 -0700
+++ b/NEWS	Mon Nov 01 11:41:59 2010 -0700
@@ -11,3 +11,4 @@
 New in release 1.0 (2010-XX-XX):
 
 * Initial release of IcedTea-Web
+* PR542: Plugin fails with NPE on http://www.openprocessing.org/visuals/iframe.php?visualID=2615
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Mon Nov 01 10:51:43 2010 -0700
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Mon Nov 01 11:41:59 2010 -0700
@@ -462,7 +462,14 @@
 
                 for (JARDesc jarDesc: file.getResources().getJARs()) {
                         try {
-                                URL location = tracker.getCacheFile(jarDesc.getLocation()).toURL();
+                                File cachedFile = tracker.getCacheFile(jarDesc.getLocation());
+                                
+                                if (cachedFile == null) {
+                                	System.err.println("JAR " + jarDesc.getLocation() + " not found. Continuing.");
+                                	continue; // JAR not found. Keep going.
+                                }
+
+                                URL location = cachedFile.toURL();
                                 SecurityDesc jarSecurity = file.getSecurity();
 
                                 if (file instanceof PluginBridge) {