Skip to content

Commit

Permalink
Merge pull request #27670 from nextcloud/backport/27663/stable21
Browse files Browse the repository at this point in the history
[stable21] Unshift crash reports when they are loaded, to break the recusion
  • Loading branch information
ChristophWurst authored Jun 25, 2021
2 parents 4058c4c + 5dd3b50 commit 22d2f05
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/private/Support/CrashReport/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use OCP\Support\CrashReport\IRegistry;
use OCP\Support\CrashReport\IReporter;
use Throwable;
use function array_shift;

class Registry implements IRegistry {

Expand Down Expand Up @@ -120,8 +121,7 @@ public function delegateMessage(string $message, array $context = []): void {
}

private function loadLazyProviders(): void {
$classes = $this->lazyReporters;
foreach ($classes as $class) {
while (($class = array_shift($this->lazyReporters)) !== null) {
try {
/** @var IReporter $reporter */
$reporter = $this->serverContainer->query($class);
Expand Down Expand Up @@ -152,6 +152,5 @@ private function loadLazyProviders(): void {
]);
}
}
$this->lazyReporters = [];
}
}

0 comments on commit 22d2f05

Please sign in to comment.