Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions apps/dav/lib/Upload/ChunkingV2Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,15 @@ public function beforeMove($sourcePath, $destination): bool {

public function beforeDelete(RequestInterface $request, ResponseInterface $response) {
try {
$this->prepareUpload($request->getPath());
if (!$this->uploadFolder instanceof UploadFolder) {
return true;
}

[$storage, $storagePath] = $this->getUploadStorage($this->uploadPath);
$storage->cancelChunkedWrite($storagePath, $this->uploadId);
return true;
} catch (NotFound $e) {
$this->prepareUpload(dirname($request->getPath()));
$this->checkPrerequisites();
} catch (StorageInvalidException|BadRequest|NotFound $e) {
return true;
}

[$storage, $storagePath] = $this->getUploadStorage($this->uploadPath);

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of OCA\DAV\Upload\ChunkingV2Plugin::getUploadStorage cannot be null, possibly null value provided
$storage->cancelChunkedWrite($storagePath, $this->uploadId);
return true;
}

/**
Expand Down