소스 검색

[WebProfilerBundle] Fixed errors on search action

Francis Besset 14 년 전
부모
커밋
190ba5979c
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

+ 4 - 1
src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

@@ -237,7 +237,10 @@ class ProfilerController extends ContainerAware
 
         $request = $this->container->get('request');
 
-        $session = $request->getSession();
+        if (null === $session = $request->getSession()) {
+            throw new \RuntimeException('To access to search, activate the session in your configuration.');
+        }
+
         $session->set('_profiler_search_ip', $ip = preg_replace('/[^\d\.]/', '', $request->query->get('ip')));
         $session->set('_profiler_search_url', $url = $request->query->get('url'));
         $session->set('_profiler_search_limit', $limit = $request->query->get('limit'));