mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix: Check return type on rollback
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
69998422d5
commit
5b77597c52
1 changed files with 8 additions and 5 deletions
|
|
@ -100,11 +100,14 @@ class VersionManager implements IVersionManager {
|
|||
public function rollback(IVersion $version) {
|
||||
$backend = $version->getBackend();
|
||||
$result = self::handleAppLocks(fn(): ?bool => $backend->rollback($version));
|
||||
\OC_Hook::emit('\OCP\Versions', 'rollback', [
|
||||
'path' => $version->getVersionPath(),
|
||||
'revision' => $version->getRevisionId(),
|
||||
'node' => $version->getSourceFile(),
|
||||
]);
|
||||
// rollback doesn't have a return type yet and some implementations don't return anything
|
||||
if ($result === null || $result === true) {
|
||||
\OC_Hook::emit('\OCP\Versions', 'rollback', [
|
||||
'path' => $version->getVersionPath(),
|
||||
'revision' => $version->getRevisionId(),
|
||||
'node' => $version->getSourceFile(),
|
||||
]);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue