incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r617494 - /incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
Date Fri, 01 Feb 2008 13:13:43 GMT
Author: bdelacretaz
Date: Fri Feb  1 05:13:41 2008
New Revision: 617494

URL: http://svn.apache.org/viewvc?rev=617494&view=rev
Log:
fail more gracefully is Servlet service not found in destroyServlet()

Modified:
    incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java

Modified: incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java?rev=617494&r1=617493&r2=617494&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
(original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
Fri Feb  1 05:13:41 2008
@@ -575,15 +575,19 @@
 
             Servlet servlet = (Servlet) context.locateService(REF_SERVLET,
                 reference);
-            String name = servlet.getServletConfig().getServletName();
-            log.debug("unbindServlet: Servlet {} removed", name);
-
-            try {
-                servlet.destroy();
-            } catch (Throwable t) {
-                log.error(
-                    "unbindServlet: Unexpected problem destroying servlet "
-                        + name, t);
+            if(servlet == null) {
+                log.error("destroyServlet: Servlet not found for reference {}", reference.toString());
+            } else {
+                String name = servlet.getServletConfig().getServletName();
+                log.debug("unbindServlet: Servlet {} removed", name);
+    
+                try {
+                    servlet.destroy();
+                } catch (Throwable t) {
+                    log.error(
+                        "unbindServlet: Unexpected problem destroying servlet "
+                            + name, t);
+                }
             }
         }
     }



Mime
View raw message