Symfony Exception

RuntimeError

HTTP 500 Internal Server Error

Impossible to access an attribute ("name") on a null variable.

Exception

Twig\Error\ RuntimeError

  1.                                                 " aria-labelledby="headingOne" data-parent="#accordion">
  2.                                         <div class="card-body">
  3.                                             <ul>
  4.                                                 <li class="mb-2 font-14">
  5.                                                     <i class="fal fa-map-marker-alt text-primary fa-lg mr-3"></i>
  6.                                                     <span>{{ campus.address }}<br/>{{ campus.code_postal }} {{ campus.city }} – {{ campus.country.name }}</span>
  7.                                                 </li>
  8.                                                 {% if (campus.telephone) %}
  9.                                                     <li class="mb-2 font-14">
  10.                                                         <i class="fal fa-phone-volume text-primary fa-lg mr-3"></i>
  11.                                                         <span><a href="tel:{{ campus.telephone }}">{{ campus.telephone }}</a></span>
  1.                 echo "<br/>";
  2.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["campus"], "code_postal", [], "any"falsefalsefalse269), "html"nulltrue);
  3.                 echo " ";
  4.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["campus"], "city", [], "any"falsefalsefalse269), "html"nulltrue);
  5.                 echo " – ";
  6.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["campus"], "country", [], "any"falsefalsefalse269), "name", [], "any"falsefalsefalse269), "html"nulltrue);
  7.                 echo "</span>
  8.                                                 </li>
  9.                                                 ";
  10.                 // line 271
  11.                 if (twig_get_attribute($this->env$this->source$context["campus"], "telephone", [], "any"falsefalsefalse271)) {
in vendor/twig/twig/src/Template.php -> block_page_content (line 171)
  1.             throw new \LogicException('A block must be a method on a \Twig\Template instance.');
  2.         }
  3.         if (null !== $template) {
  4.             try {
  5.                 $template->$block($context$blocks);
  6.             } catch (Error $e) {
  7.                 if (!$e->getSourceContext()) {
  8.                     $e->setSourceContext($template->getSourceContext());
  9.                 }
  1.         echo "    <!--Off Canvas Navigation End-->
  2.     <div class=\"site-wrapper\">
  3.         ";
  4.         // line 137
  5.         $this->displayBlock('page_content'$context$blocks);
  6.         // line 138
  7.         echo "    </div>
  8.     <!-- Footer Section -->
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
  1.         $macros $this->macros;
  2.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  3.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""web/page/program/detail.html.twig"));
  4.         $this->parent $this->loadTemplate("web/layout/base.html.twig""web/page/program/detail.html.twig"1);
  5.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  6.         
  7.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  8.     }
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
in vendor/twig/twig/src/Template.php -> display (line 379)
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.     public function render(array $context = []): string
  2.     {
  3.         // using func_get_args() allows to not expose the blocks argument
  4.         // as it should only be used by internal code
  5.         return $this->template->render($context, \func_get_args()[1] ?? []);
  6.     }
  7.     public function display(array $context = [])
  8.     {
  9.         // using func_get_args() allows to not expose the blocks argument
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = []): string
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.         if ($this->container->has('templating')) {
  2.             @trigger_error('Using the "templating" service is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.', \E_USER_DEPRECATED);
  3.             $content $this->container->get('templating')->render($view$parameters);
  4.         } elseif ($this->container->has('twig')) {
  5.             $content $this->container->get('twig')->render($view$parameters);
  6.         } else {
  7.             throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".');
  8.         }
  9.         if (null === $response) {
AbstractController->render() in src/Controller/Web/ProgramController.php (line 112)
  1.              break;
  2.         }
  3.         return $this->render($templatePath, [
  4.             'program' => $program,
  5.             'related' => $related
  6.         ]);
  7.     }
  8. }
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle() in public/index.php (line 25)
  1.     Request::setTrustedHosts([$trustedHosts]);
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

RuntimeError

Twig\Error\RuntimeError:
Impossible to access an attribute ("name") on a null variable.

  at templates/web/page/program/detail.html.twig:269
  at twig_get_attribute()
     (var/cache/staging/twig/24/24d6537d6983f72b6b687189bcf50ff6609c0c83385665169bbab84586edace8.php:616)
  at __TwigTemplate_455c8a3d353c4e9f5926c3b345fe602c8f1de8e96f396599a1e402356a163957->block_page_content()
     (vendor/twig/twig/src/Template.php:171)
  at Twig\Template->displayBlock()
     (var/cache/staging/twig/88/8834396a33cb490f563ad81dbcd8d32cde1584c510b5be8dad33a4eef78f4767.php:228)
  at __TwigTemplate_44e3c7774aea06a8fe2201145b7d65dcc202713f33ecf3b1fb2e3e8b1db08d1d->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (var/cache/staging/twig/24/24d6537d6983f72b6b687189bcf50ff6609c0c83385665169bbab84586edace8.php:45)
  at __TwigTemplate_455c8a3d353c4e9f5926c3b345fe602c8f1de8e96f396599a1e402356a163957->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (vendor/twig/twig/src/Template.php:379)
  at Twig\Template->render()
     (vendor/twig/twig/src/TemplateWrapper.php:40)
  at Twig\TemplateWrapper->render()
     (vendor/twig/twig/src/Environment.php:277)
  at Twig\Environment->render()
     (vendor/symfony/framework-bundle/Controller/ControllerTrait.php:235)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
     (src/Controller/Web/ProgramController.php:112)
  at App\Controller\Web\ProgramController->detail()
     (vendor/symfony/http-kernel/HttpKernel.php:158)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:80)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:25)