diff --git a/lib/private/Support/CrashReport/Registry.php b/lib/private/Support/CrashReport/Registry.php index bff62705cebcb..d9f9097ada3e2 100644 --- a/lib/private/Support/CrashReport/Registry.php +++ b/lib/private/Support/CrashReport/Registry.php @@ -36,6 +36,7 @@ use OCP\Support\CrashReport\IRegistry; use OCP\Support\CrashReport\IReporter; use Throwable; +use function array_shift; class Registry implements IRegistry { @@ -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); @@ -152,6 +152,5 @@ private function loadLazyProviders(): void { ]); } } - $this->lazyReporters = []; } }