fixed error message

This commit is contained in:
Fabien Potencier 2015-01-25 03:16:21 +01:00
parent 62decf0bf7
commit 89e57ec523
1 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,10 @@ class AppVariable
*/
public function getSession()
{
if (null === $this->requestStack && null === $this->container) {
throw new \RuntimeException('The "app.session" variable is not available.');
}
if ($request = $this->getRequest()) {
return $request->getSession();
}