Merge pull request #145 from tuuzed/tuuzed-fix-bugs

fix: 🐛 DoUnlock空指针异常
This commit is contained in:
zxbu 2021-12-20 09:09:10 +08:00 committed by GitHub
commit 6ade2dbfe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)) {
StoredObject so = _store.getStoredObject(
transaction, path);
if (so == null) {
resp.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
if (so.isNullResource()) {
_store.removeObject(transaction, path);
}