From 4d060818d1215ce7bec25a1f65971207f54c20dd Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Mon, 29 Apr 2024 15:22:19 +0200 Subject: fix(files_external): Be extra safe with null handling to please psalm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/files_external/lib/Lib/Storage/SFTP.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps/files_external/lib/Lib') diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index e6fc5dd3e22..1430b607519 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -513,6 +513,9 @@ class SFTP extends Common { $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"); -- cgit v1.2.3