diff --git a/Controller/SymfonyProfilerController.php b/Controller/SymfonyProfilerController.php index af27dbbd..7e7fad22 100644 --- a/Controller/SymfonyProfilerController.php +++ b/Controller/SymfonyProfilerController.php @@ -149,7 +149,11 @@ private function getMessage(Request $request, $token) $messageId = $request->request->get('message_id', $request->query->get('message_id')); $profile = $profiler->loadProfile($token); - $messages = $profile->getCollector('translation')->getMessages(); + if (null === $dataCollector = $profile->getCollector('translation')) { + throw $this->createNotFoundException('No collector with name "translation" was found.'); + } + + $messages = $dataCollector->getMessages(); if (!isset($messages[$messageId])) { throw $this->createNotFoundException(sprintf('No message with key "%s" was found.', $messageId)); }