juergen     2002/10/21 05:07:10

  Modified:    src/webdav/server/org/apache/slide/webdav WebdavServlet.java
  Log:
  fixed Nullpointer if HTTP method is not allowed (eckehard)
  
  Revision  Changes    Path
  1.50      +11 -7     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java
  
  Index: WebdavServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- WebdavServlet.java        1 Aug 2002 08:25:24 -0000       1.49
  +++ WebdavServlet.java        21 Oct 2002 12:07:10 -0000      1.50
  @@ -118,7 +118,7 @@
       
       /**
        * Name under which the namespace access token is stored in the application
  -     * attributes. This is used when the WebDAV servlet doesn't initialize 
  +     * attributes. This is used when the WebDAV servlet doesn't initialize
        * Slide itself, but rather the initialization is done outside.
        */
       public static final String ATTRIBUTE_NAME =
  @@ -218,7 +218,11 @@
                   super.service(req, resp);
               } else {
                   WebdavMethod method = methodFactory.createMethod(methodName);
  -                method.run(req, resp);
  +                if (method == null) {
  +                    throw new WebdavException(WebdavStatus.SC_METHOD_NOT_ALLOWED);
  +                } else {
  +                    method.run(req, resp);
  +                }
               }
               
               // if logging for the request/response is required
  @@ -383,7 +387,7 @@
               WebdavMethodFactory.newInstance(
                   (WebdavServletConfig)getServletConfig());
           
  -        // Check whether directory browsing is enabled, and how it should be 
  +        // Check whether directory browsing is enabled, and how it should be
           // accomplished
           value = getInitParameter("directory-browsing");
           if (value != null) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:slide-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:slide-dev-help@;jakarta.apache.org>

Reply via email to