felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r903968 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
Date Thu, 28 Jan 2010 06:29:41 GMT
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 )



Mime
View raw message