diff --git a/src/main/java/net/sf/webdav/methods/DoLock.java b/src/main/java/net/sf/webdav/methods/DoLock.java index d5af92f..a57e8d3 100644 --- a/src/main/java/net/sf/webdav/methods/DoLock.java +++ b/src/main/java/net/sf/webdav/methods/DoLock.java @@ -209,6 +209,9 @@ public class DoLock extends AbstractMethod { return; } nullSo = _store.getStoredObject(transaction, _path); + if (nullSo == null) { + nullSo = new StoredObject(); + } // define the newly created resource as null-resource nullSo.setNullResource(true); @@ -416,8 +419,13 @@ public class DoLock extends AbstractMethod { if (currentNode.getNodeType() == Node.ELEMENT_NODE || currentNode.getNodeType() == Node.TEXT_NODE) { - _lockOwner = currentNode.getFirstChild() - .getNodeValue(); + if (currentNode.getFirstChild() != null) { + _lockOwner = currentNode.getFirstChild() + .getNodeValue(); + } else { + _lockOwner = currentNode.toString(); + } + } } }