incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r575690 - /incubator/sling/trunk/sling-servlet/src/main/java/org/apache/sling/launcher/servlet/SlingServlet.java
Date Fri, 14 Sep 2007 14:11:32 GMT
Author: cziegeler
Date: Fri Sep 14 07:11:32 2007
New Revision: 575690

URL: http://svn.apache.org/viewvc?rev=575690&view=rev
Log:
Prevent NPE when obr resource is not found.

Modified:
    incubator/sling/trunk/sling-servlet/src/main/java/org/apache/sling/launcher/servlet/SlingServlet.java

Modified: incubator/sling/trunk/sling-servlet/src/main/java/org/apache/sling/launcher/servlet/SlingServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling-servlet/src/main/java/org/apache/sling/launcher/servlet/SlingServlet.java?rev=575690&r1=575689&r2=575690&view=diff
==============================================================================
--- incubator/sling/trunk/sling-servlet/src/main/java/org/apache/sling/launcher/servlet/SlingServlet.java
(original)
+++ incubator/sling/trunk/sling-servlet/src/main/java/org/apache/sling/launcher/servlet/SlingServlet.java
Fri Sep 14 07:11:32 2007
@@ -312,7 +312,10 @@
         if ( repoLocation != null && repoLocation.indexOf(":/") < 1 &&
repoLocation.startsWith("/")) {
             try {
                 final URL url = this.getServletContext().getResource(repoLocation);
-                props.put(OBR_REPOSITORY_URL, url.toExternalForm());
+                // only if we get back a resource url, we update it
+                if ( url != null ) {
+                    props.put(OBR_REPOSITORY_URL, url.toExternalForm());
+                }
             } catch (MalformedURLException e) {
                 // if an exception occurs, we ignore it
             }



Mime
View raw message