Skip to content

Commit db9466e

Browse files
Merge pull request #52 from punktDe/bugfix/prevent-exception-in-cli-in-account-check
BUGFIX: adjust check in getCurrentBackendUser to prevent exception in cli
2 parents dd0e30a + fd2a463 commit db9466e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Domain/ScheduledExport/ScheduledExportService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ public function removeScheduledExportDefinitionIfExists(string $formIdentifier):
6767

6868
protected function getCurrentBackendUser(): string
6969
{
70-
return $this->securityContext->getAccount() instanceof Account ? $this->securityContext->getAccount()->getAccountIdentifier() : 'unknown';
70+
return $this->securityContext->canBeInitialized() && $this->securityContext->getAccount() instanceof Account ? $this->securityContext->getAccount()->getAccountIdentifier() : 'unknown';
7171
}
7272
}

0 commit comments

Comments
 (0)