diff --git a/src/sentry/src/Hub.php b/src/sentry/src/Hub.php index 20317df6..bb9783b0 100644 --- a/src/sentry/src/Hub.php +++ b/src/sentry/src/Hub.php @@ -58,7 +58,8 @@ public function getLastEventId(): ?EventId public function pushScope(): Scope { $clonedScope = clone $this->getScope(); - Context::override(static::CONTEXT_STACK_KEY, function (array $layers) use ($clonedScope) { + Context::override(static::CONTEXT_STACK_KEY, function ($layers) use ($clonedScope) { + $layers = $layers ?? []; $layers[] = new Layer($this->getClient(), $clonedScope); return $layers;