[HttpKernel] added a safeguard for when a fragment is rendered outside the context of a master request
This commit is contained in:
parent
5d7b8356ab
commit
bb83b3ea43
@ -93,6 +93,10 @@ class FragmentHandler
|
||||
throw new \InvalidArgumentException(sprintf('The "%s" renderer does not exist.', $renderer));
|
||||
}
|
||||
|
||||
if (null === $this->request) {
|
||||
throw new \LogicException('Rendering a fragment can only be done when handling a master Request.');
|
||||
}
|
||||
|
||||
return $this->deliver($this->renderers[$renderer]->render($uri, $this->request, $options));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user