You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by fm...@apache.org on 2010/01/28 07:29:41 UTC

svn commit: r903968 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java

Author: fmeschbe
Date: Thu Jan 28 06:29:41 2010
New Revision: 903968

URL: http://svn.apache.org/viewvc?rev=903968&view=rev
Log:
FELIX-2017 prevent NullPointerException if URLConnection.getInputStream() returns
null instead of throwing for a non-existing resource.

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java?rev=903968&r1=903967&r2=903968&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java (original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java Thu Jan 28 06:29:41 2010
@@ -346,6 +346,14 @@
             URLConnection connection = url.openConnection();
             ins = connection.getInputStream();
 
+            // FELIX-2017 Equinox may return an URL for a non-existing
+            // resource but then (instead of throwing) return null on
+            // getInputStream. We should account for this situation and
+            // just assume a non-existing resource in this case.
+            if (ins == null) {
+                return false;
+            }
+
             // check whether we may return 304/UNMODIFIED
             long lastModified = connection.getLastModified();
             if ( lastModified > 0 )