Browse Source

修复 DAVFS客户端上传文件时空指针的BUG

main
zhouxin 4 years ago
parent
commit
fec2079f5c
  1. 12
      src/main/java/net/sf/webdav/methods/DoLock.java

12
src/main/java/net/sf/webdav/methods/DoLock.java

@ -209,6 +209,9 @@ public class DoLock extends AbstractMethod {
return; return;
} }
nullSo = _store.getStoredObject(transaction, _path); nullSo = _store.getStoredObject(transaction, _path);
if (nullSo == null) {
nullSo = new StoredObject();
}
// define the newly created resource as null-resource // define the newly created resource as null-resource
nullSo.setNullResource(true); nullSo.setNullResource(true);
@ -416,8 +419,13 @@ public class DoLock extends AbstractMethod {
if (currentNode.getNodeType() == Node.ELEMENT_NODE if (currentNode.getNodeType() == Node.ELEMENT_NODE
|| currentNode.getNodeType() == Node.TEXT_NODE) { || currentNode.getNodeType() == Node.TEXT_NODE) {
_lockOwner = currentNode.getFirstChild() if (currentNode.getFirstChild() != null) {
.getNodeValue(); _lockOwner = currentNode.getFirstChild()
.getNodeValue();
} else {
_lockOwner = currentNode.toString();
}
} }
} }
} }

Loading…
Cancel
Save