Permalink
Browse files

[HttpKernel] added a safeguard for when a fragment is rendered outsid…

…e the context of a master request
  • Loading branch information...
1 parent 5d7b835 commit bb83b3ea43f04f3d2040f19cf4df811b502b295a @fabpot fabpot committed Mar 20, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php
@@ -93,6 +93,10 @@ public function render($uri, $renderer = 'inline', array $options = array())
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));
}

0 comments on commit bb83b3e

Please sign in to comment.