Merge pull request #48102 from nextcloud/backport/46218/stable27

[stable27] Ensure that the hash method does not return null
This commit is contained in:
Arthur Schiwon 2024-12-05 13:18:38 +01:00 committed by GitHub
commit 4faa061eb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -439,7 +439,7 @@ class Local extends \OC\Files\Storage\Common {
return $result;
}
public function hash($type, $path, $raw = false) {
public function hash($type, $path, $raw = false): string|false {
return hash_file($type, $this->getSourcePath($path), $raw);
}

View file

@ -334,6 +334,7 @@ class Availability extends Wrapper {
return parent::hash($type, $path, $raw);
} catch (StorageNotAvailableException $e) {
$this->setUnavailable($e);
return false;
}
}