Skip to content

Commit 8fd8b72

Browse files
Merge pull request #11745 from nextcloud/fix/migration/check-method-exists
fix(migration): check if account service method exists
2 parents 775a1b2 + 4133178 commit 8fd8b72

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Migration/FixBackgroundJobs.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use OCA\Mail\Service\AccountService;
1313
use OCP\Migration\IOutput;
1414
use OCP\Migration\IRepairStep;
15+
use function method_exists;
1516

1617
class FixBackgroundJobs implements IRepairStep {
1718
public function __construct(
@@ -30,6 +31,11 @@ public function getName(): string {
3031
*/
3132
#[\Override]
3233
public function run(IOutput $output) {
34+
// Skip if method does not exist yet during upgrade
35+
if (!method_exists($this->accountService, 'scheduleBackgroundJobs')) {
36+
return;
37+
}
38+
3339
$accounts = $this->mapper->getAllAccounts();
3440

3541
$output->startProgress(count($accounts));

0 commit comments

Comments
 (0)