diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-04-29 15:22:19 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-04-30 09:24:00 +0200 |
commit | 4d060818d1215ce7bec25a1f65971207f54c20dd (patch) | |
tree | 5e63e591e5597a7a44739b5b0ab64b82171ac74e /apps/files_external/lib/Lib | |
parent | 2333657fb6727860f512dcd55e92bdd5e856e2e6 (diff) | |
download | nextcloud-server-4d060818d1215ce7bec25a1f65971207f54c20dd.tar.gz nextcloud-server-4d060818d1215ce7bec25a1f65971207f54c20dd.zip |
fix(files_external): Be extra safe with null handling to please psalm
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files_external/lib/Lib')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SFTP.php | 3 |
1 files changed, 3 insertions, 0 deletions
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"); |