changeset 2077:3ec77b8b0bcd

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:07:23 -0400
parents 617fcc039423
children 01d87c70057a
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:41:38 2010 -0400
+++ b/ChangeLog	Tue Aug 24 10:07:23 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:41:38 2010 -0400
+++ b/NEWS	Tue Aug 24 10:07:23 2010 -0400
@@ -4,6 +4,7 @@
   - Fix browser command in BasicService.showDocument(URL)
   - Run programs that inherit main(String[]) in their main-class
   - Run JNLP files that use 1.6 as the spec version
+  - 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:41:38 2010 -0400
+++ b/netx/net/sourceforge/jnlp/JNLPSplashScreen.java	Tue Aug 24 10:07:23 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);