Skip to content

Commit 4faa061

Browse files
authored
Merge pull request #48102 from nextcloud/backport/46218/stable27
[stable27] Ensure that the hash method does not return null
2 parents cfb51dd + 03a777b commit 4faa061

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

lib/private/Files/Storage/Local.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ public function fopen($path, $mode) {
439439
return $result;
440440
}
441441

442-
public function hash($type, $path, $raw = false) {
442+
public function hash($type, $path, $raw = false): string|false {
443443
return hash_file($type, $this->getSourcePath($path), $raw);
444444
}
445445

lib/private/Files/Storage/Wrapper/Availability.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ public function hash($type, $path, $raw = false) {
334334
return parent::hash($type, $path, $raw);
335335
} catch (StorageNotAvailableException $e) {
336336
$this->setUnavailable($e);
337+
return false;
337338
}
338339
}
339340

0 commit comments

Comments
 (0)