Browse Source

fix(files_external): Be extra safe with null handling to please psalm

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/44533/head
Côme Chilliet 1 month ago
parent
commit
4d060818d1
No account linked to committer's email address
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      apps/files_external/lib/Lib/Storage/SFTP.php

+ 3
- 0
apps/files_external/lib/Lib/Storage/SFTP.php View File

$result = $this->getConnection()->put($this->absPath($path), $stream); $result = $this->getConnection()->put($this->absPath($path), $stream);
fclose($stream); fclose($stream);
if ($result) { if ($result) {
if ($size === null) {
throw new \Exception("Failed to get written size from sftp storage wrapper");
}
return $size; return $size;
} else { } else {
throw new \Exception("Failed to write steam to sftp storage"); throw new \Exception("Failed to write steam to sftp storage");

Loading…
Cancel
Save