changeset 2231:d59cbcab0fe4

netx: check for possible null in splash screen code 2010-08-24 Omair Majid <omajid@redhat.com> Fixes rhbz601281 * NEWS: Update with this fix. * netx/net/sourceforge/jnlp/JNLPSplashScreen.java (setSplashImageURL): Check for possible null.
author omajid
date Tue, 24 Aug 2010 10:11:26 -0400
parents 933fec08a004
children adf4b68ed6af
files ChangeLog NEWS netx/net/sourceforge/jnlp/JNLPSplashScreen.java
diffstat 3 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Aug 23 17:49:28 2010 -0400
+++ b/ChangeLog	Tue Aug 24 10:11:26 2010 -0400
@@ -1,3 +1,10 @@
+2010-08-24  Omair Majid  <omajid@redhat.com>
+
+	Fixes rhbz601281
+	* NEWS: Update with this fix.
+	* netx/net/sourceforge/jnlp/JNLPSplashScreen.java
+	(setSplashImageURL): Check for possible null.
+
 2010-08-23  Andrew Su  <asu@redhat.com>
 
         * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
--- a/NEWS	Mon Aug 23 17:49:28 2010 -0400
+++ b/NEWS	Tue Aug 24 10:11:26 2010 -0400
@@ -721,6 +721,7 @@
   - Fix browser command in BasicService.showDocument(URL)
   - Run programs that inherit main(String[]) in their main-class
   - Run JNLP files that use spec version 1.6
+  - RH601281: Possible NullPointerException in splash screen code
 
 New in release 1.8.1 (2010-07-28):
 
--- a/netx/net/sourceforge/jnlp/JNLPSplashScreen.java	Mon Aug 23 17:49:28 2010 -0400
+++ b/netx/net/sourceforge/jnlp/JNLPSplashScreen.java	Tue Aug 24 10:11:26 2010 -0400
@@ -44,6 +44,12 @@
         try {
             splashImage = ImageIO.read(resourceTracker
                     .getCacheFile(splashImageUrl));
+            if (splashImage == null) {
+                if (JNLPRuntime.isDebug()) {
+                    System.err.println("Error loading splash image: " + url);
+                }
+                return;
+            }
         } catch (IOException e) {
             if (JNLPRuntime.isDebug()) {
                 System.err.println("Error loading splash image: " + url);