Skip to content

Commit

Permalink
Merge pull request #48102 from nextcloud/backport/46218/stable27
Browse files Browse the repository at this point in the history
[stable27] Ensure that the hash method does not return null
  • Loading branch information
blizzz authored Dec 5, 2024
2 parents cfb51dd + 03a777b commit 4faa061
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public function fopen($path, $mode) {
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);
}

Expand Down
1 change: 1 addition & 0 deletions lib/private/Files/Storage/Wrapper/Availability.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ public function hash($type, $path, $raw = false) {
return parent::hash($type, $path, $raw);
} catch (StorageNotAvailableException $e) {
$this->setUnavailable($e);
return false;
}
}

Expand Down

0 comments on commit 4faa061

Please sign in to comment.