You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2024/10/22 12:17:04 UTC

(tomcat) 12/19: Add additional test. lock may be null here

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit b5a6f0405d4f5b491fb53bb7fa4daa4b5e21f7d1
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Oct 22 08:36:22 2024 +0100

    Add additional test. lock may be null here
---
 java/org/apache/catalina/servlets/WebdavServlet.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java b/java/org/apache/catalina/servlets/WebdavServlet.java
index f6e77cf844..42fbc80d6c 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1643,7 +1643,7 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen
                                 if (lockTokenHeader.contains(token)) {
                                     LockInfo lock = sharedLocks.get(token);
                                     if (lock == null || lock.principal == null || lock.principal.equals(req.getRemoteUser())) {
-                                        if ((parentPath != path && lock.depth > 0) || parentPath == path) {
+                                        if ((parentPath != path && lock != null && lock.depth > 0) || parentPath == path) {
                                             parentLock.sharedTokens.remove(token);
                                             if (parentLock.sharedTokens.isEmpty()) {
                                                 resourceLocks.remove(parentPath);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org