mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: Check return type on rollback
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
62e6a32899
commit
f00f4244d4
1 changed files with 8 additions and 5 deletions
|
|
@ -95,11 +95,14 @@ class VersionManager implements IVersionManager, INameableVersionBackend, IDelet
|
|||
public function rollback(IVersion $version) {
|
||||
$backend = $version->getBackend();
|
||||
$result = $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