diff --git a/apps/files/lib/Command/TransferOwnership.php b/apps/files/lib/Command/TransferOwnership.php
index cd776aaa4ef..022db999200 100644
--- a/apps/files/lib/Command/TransferOwnership.php
+++ b/apps/files/lib/Command/TransferOwnership.php
@@ -96,12 +96,12 @@ class TransferOwnership extends Command {
if (!$sourceUserObject instanceof IUser) {
$output->writeln("Unknown source user $this->sourceUser");
- return;
+ return 1;
}
if (!$destinationUserObject instanceof IUser) {
$output->writeln("Unknown destination user $this->destinationUser");
- return;
+ return 1;
}
$this->sourceUser = $sourceUserObject->getUID();
@@ -110,7 +110,7 @@ class TransferOwnership extends Command {
// target user has to be ready
if (!\OC::$server->getEncryptionManager()->isReadyForUser($this->destinationUser)) {
$output->writeln("The target user is not ready to accept files. The user has at least to be logged in once.");
- return;
+ return 2;
}
$date = date('c');