Skip to content

Commit 7dceaa1

Browse files
elementairenicolas-grekas
authored andcommitted
[HttpKernel] Handle nullable callback of StreamedResponse
1 parent b50f5e2 commit 7dceaa1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

StreamedResponse.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ public function setCallback(callable $callback): static
5656
return $this;
5757
}
5858

59-
public function getCallback(): \Closure
59+
public function getCallback(): ?\Closure
6060
{
61+
if (!isset($this->callback)) {
62+
return null;
63+
}
64+
6165
return ($this->callback)(...);
6266
}
6367

0 commit comments

Comments
 (0)