{"action":"created","issue":{"url":"https://api.github.com/repos/eXist-db/exist/issues/835","labels_url":"https://api.github.com/repos/eXist-db/exist/issues/835/labels{/name}","comments_url":"https://api.github.com/repos/eXist-db/exist/issues/835/comments","events_url":"https://api.github.com/repos/eXist-db/exist/issues/835/events","html_url":"https://github.com/eXist-db/exist/issues/835","id":117618202,"number":835,"title":"NPE when uploading a file to replace an existing file over WebDAV","user":{"login":"joewiz","id":59118,"avatar_url":"https://avatars.githubusercontent.com/u/59118?v=3","gravatar_id":"","url":"https://api.github.com/users/joewiz","html_url":"https://github.com/joewiz","followers_url":"https://api.github.com/users/joewiz/followers","following_url":"https://api.github.com/users/joewiz/following{/other_user}","gists_url":"https://api.github.com/users/joewiz/gists{/gist_id}","starred_url":"https://api.github.com/users/joewiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joewiz/subscriptions","organizations_url":"https://api.github.com/users/joewiz/orgs","repos_url":"https://api.github.com/users/joewiz/repos","events_url":"https://api.github.com/users/joewiz/events{/privacy}","received_events_url":"https://api.github.com/users/joewiz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-18T16:01:06Z","updated_at":"2015-11-29T10:20:56Z","closed_at":null,"body":"Steps to reproduce: Using the current develop branch, upload any XML document (e.g., `test.xml`) to the db (e.g., `/db/test.xml`) via WebDAV. This works. Upload it a second time: error 500, with exist.log showing the following error:\r\n\r\n```\r\n2015-11-18 10:59:01,434 [eXistThread-41] INFO  (MiltonResource.java [authorise]:351) - PUT /db (write=true) \r\n2015-11-18 10:59:05,938 [eXistThread-42] INFO  (HttpManager.java [process]:213) - PUT :: http://localhost:8080/exist/webdav/db/test.xml - http://localhost:8080/exist/webdav/db/test.xml \r\n2015-11-18 10:59:05,939 [eXistThread-42] ERROR (StandardFilter.java [process]:68) - process \r\njava.lang.NullPointerException\r\n\tat java.util.Objects.requireNonNull(Objects.java:203) ~[?:1.8.0_45]\r\n\tat java.util.Optional.<init>(Optional.java:96) ~[?:1.8.0_45]\r\n\tat java.util.Optional.of(Optional.java:108) ~[?:1.8.0_45]\r\n\tat org.exist.webdav.ExistDocument.getCurrentLock(ExistDocument.java:298) ~[exist-webdav.jar:?]\r\n\tat org.exist.webdav.MiltonDocument.getCurrentLock(MiltonDocument.java:503) ~[exist-webdav.jar:?]\r\n\tat com.bradmcevoy.http.HandlerHelper.isLockedOut(HandlerHelper.java:152) ~[milton-api-1.8.1.3.jar:?]\r\n\tat com.bradmcevoy.http.http11.PutHandler.process(PutHandler.java:109) ~[milton-api-1.8.1.3.jar:?]\r\n\tat com.bradmcevoy.http.StandardFilter.process(StandardFilter.java:52) [milton-api-1.8.1.3.jar:?]\r\n\tat com.bradmcevoy.http.FilterChain.process(FilterChain.java:40) [milton-api-1.8.1.3.jar:?]\r\n\tat com.bradmcevoy.http.HttpManager.process(HttpManager.java:228) [milton-api-1.8.1.3.jar:?]\r\n\tat com.bradmcevoy.http.MiltonServlet.service(MiltonServlet.java:195) [milton-servlet-1.8.1.3.jar:?]\r\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503) [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:575) [jetty-security-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429) [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:229) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:103) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:50) [exist-optional.jar:?]\r\n\tat org.exist.http.urlrewrite.XQueryURLRewrite.service(XQueryURLRewrite.java:221) [exist-optional.jar:?]\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:848) [servlet-api-3.0.jar:?]\r\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503) [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533) [jetty-security-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429) [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.Server.handle(Server.java:370) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) [jetty-http-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) [jetty-http-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696) [jetty-io-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53) [jetty-io-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-8.1.17.v20150415.jar:8.1.17.v20150415]\r\n\tat java.lang.Thread.run(Thread.java:745) [?:1.8.0_45]\r\n```"},"comment":{"url":"https://api.github.com/repos/eXist-db/exist/issues/comments/160397328","html_url":"https://github.com/eXist-db/exist/issues/835#issuecomment-160397328","issue_url":"https://api.github.com/repos/eXist-db/exist/issues/835","id":160397328,"user":{"login":"adamretter","id":1264057,"avatar_url":"https://avatars.githubusercontent.com/u/1264057?v=3","gravatar_id":"","url":"https://api.github.com/users/adamretter","html_url":"https://github.com/adamretter","followers_url":"https://api.github.com/users/adamretter/followers","following_url":"https://api.github.com/users/adamretter/following{/other_user}","gists_url":"https://api.github.com/users/adamretter/gists{/gist_id}","starred_url":"https://api.github.com/users/adamretter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamretter/subscriptions","organizations_url":"https://api.github.com/users/adamretter/orgs","repos_url":"https://api.github.com/users/adamretter/repos","events_url":"https://api.github.com/users/adamretter/events{/privacy}","received_events_url":"https://api.github.com/users/adamretter/received_events","type":"User","site_admin":false},"created_at":"2015-11-29T10:20:56Z","updated_at":"2015-11-29T10:20:56Z","body":"Okay cool. Do you want to merge it?\n\nOn Saturday, 28 November 2015, Joe Wicentowski <notifications@github.com>\nwrote:\n\n> @adamretter <https://github.com/adamretter> Thanks so much! I've tested\n> your branch and can confirm that my problem is fixed. I tested upload,\n> move, rename, and delete - and all work as expected.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/eXist-db/exist/issues/835#issuecomment-160307024>.\n>\n\n\n-- \nAdam Retter\n\nskype: adam.retter\ntweet: adamretter\nhttp://www.adamretter.org.uk\n"}}