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

This commit is contained in:
zhouxin 2021-08-01 21:50:13 +08:00
parent 83283a2133
commit fec2079f5c
1 changed files with 10 additions and 2 deletions

View File

@ -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();
}
} }
} }
} }