Skip to content

Commit 4289fc4

Browse files
authored
Guard against empty cache event keys (#1031)
1 parent 7bec508 commit 4289fc4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Sentry/Laravel/Features/CacheIntegration.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,12 @@ private function getSessionKey(): ?string
280280
/**
281281
* Replace a session key with a placeholder.
282282
*/
283-
private function replaceSessionKey(string $value): string
283+
private function replaceSessionKey(?string $value): string
284284
{
285+
if (!is_string($value)) {
286+
return '{empty key}';
287+
}
288+
285289
return $value === $this->getSessionKey() ? '{sessionKey}' : $value;
286290
}
287291

0 commit comments

Comments
 (0)