changeset 2148:c4b749a83103

Backport fix for PR542 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.
author Omair Majid <omajid@redhat.com>
date Fri, 25 Mar 2011 15:36:46 -0400
parents 015d29e3b82a
children b0f229f276be
files ChangeLog NEWS netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
diffstat 3 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Mar 25 13:25:46 2011 +0100
+++ b/ChangeLog	Fri Mar 25 15:36:46 2011 -0400
@@ -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.
+
 2011-03-25  Xerxes Ranby  <xerxes@zafena.se>
             Mark Wielaard  <mark@klomp.org>
 
--- a/NEWS	Fri Mar 25 13:25:46 2011 +0100
+++ b/NEWS	Fri Mar 25 15:36:46 2011 -0400
@@ -14,6 +14,8 @@
   - S6675802: Regression: heavyweight popups cause SecurityExceptions in applets
   - S6691503: Malicious applet can show always-on-top popup menu which has whole screen size
   - PR632: patches/security/20110215/6878713.patch breaks shark zero build
+* Plugin
+  - PR542: Plugin fails with NPE on http://www.openprocessing.org/visuals/iframe.php?visualID=2615
 
 New in release 1.8.7 (2011-02-15):
 
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Fri Mar 25 13:25:46 2011 +0100
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Fri Mar 25 15:36:46 2011 -0400
@@ -424,7 +424,14 @@
 		
 		for (JARDesc jarDesc: file.getResources().getJARs()) {
 			try {
-				URL location = tracker.getCacheFile(jarDesc.getLocation()).toURI().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) {