Skip to content

Commit

Permalink
fix(files_external): Be extra safe with null handling to please psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Apr 29, 2024
1 parent a213642 commit 4b99cd4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/files_external/lib/Lib/Storage/SFTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,9 @@ public function writeStream(string $path, $stream, ?int $size = null): int {
$result = $this->getConnection()->put($this->absPath($path), $stream);
fclose($stream);
if ($result) {
if ($size === null) {
throw new \Exception("Failed to get written size from sftp storage wrapper");
}
return $size;
} else {
throw new \Exception("Failed to write steam to sftp storage");
Expand Down

0 comments on commit 4b99cd4

Please sign in to comment.