fix: 🐛 DoUnlock空指针异常

This commit is contained in:
liuyonghui 2021-12-15 15:08:47 +08:00
parent c9e87bfcd7
commit f0bdb77674
1 changed files with 5 additions and 0 deletions

View File

@ -72,6 +72,11 @@ public class DoUnlock extends DeterminableMethod {
if (_resourceLocks.unlock(transaction, lockId, owner)) { if (_resourceLocks.unlock(transaction, lockId, owner)) {
StoredObject so = _store.getStoredObject( StoredObject so = _store.getStoredObject(
transaction, path); transaction, path);
if (so == null) {
resp.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
if (so.isNullResource()) { if (so.isNullResource()) {
_store.removeObject(transaction, path); _store.removeObject(transaction, path);
} }