Symfony Exception

RuntimeError

HTTP 500 Internal Server Error

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

Exception

Twig\Error\ RuntimeError

  1.             </a>
  2.         </h1>
  3.     </header>
  4.     <section class="vacancy">
  5.         <div class="content">
  6.             {{ vacancy.profile|raw }}
  7.         </div>
  8.     </section>
  9.     <section class="contact">
  10.         <div class="content">
  1.     </header>
  2.     <section class=\"vacancy\">
  3.         <div class=\"content\">
  4.             ";
  5.         // line 24
  6.         echo twig_get_attribute($this->env$this->source, (isset($context["vacancy"]) || array_key_exists("vacancy"$context) ? $context["vacancy"] : (function () { throw new RuntimeError('Variable "vacancy" does not exist.'24$this->source); })()), "profile", [], "any"falsefalsefalse24);
  7.         echo "
  8.         </div>
  9.     </section>
  10.     <section class=\"contact\">
in vendor/twig/twig/src/Template.php->block_body (line 184)
  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.         // line 50
  2.         echo "    </head>
  3.     <body>
  4.         ";
  5.         // line 52
  6.         $this->displayBlock('body'$context$blocks);
  7.         // line 54
  8.         echo "        ";
  9.         $this->displayBlock('javascript'$context$blocks);
  10.         // line 56
  11.         echo "    </body>
in vendor/twig/twig/src/Template.php->doDisplay (line 407)
  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 380)
  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""index/vacancy.html.twig"));
  4.         $this->parent $this->loadTemplate("index/base.html.twig""index/vacancy.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 407)
  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 380)
  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 392)
  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.      */
  2.     public function render(array $context = []): string
  3.     {
  4.         // using func_get_args() allows to not expose the blocks argument
  5.         // as it should only be used by internal code
  6.         return $this->template->render($context, \func_get_args()[1] ?? []);
  7.     }
  8.     /**
  9.      * Displays the template.
  10.      *
in vendor/twig/twig/src/Environment.php->render (line 318)
  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 = [])
  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('index/vacancy.html.twig', array('vacancy' => null)) in src/Controller/IndexController.php (line 47)
  1.         $vacancy $entityManager->getRepository(Vacancy::class)->findOneBy(['seoTitle' => $request->get('seotitle')]);
  2.         return $this->render(
  3.             'index/vacancy.html.twig',
  4.             [
  5.                 'vacancy' => $vacancy,
  6.             ]
  7.         );
  8.     }
  9.     /**
  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'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(object(Request)) 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 ("profile") on a null variable.

  at templates/index/vacancy.html.twig:24
  at twig_get_attribute(object(Environment), object(Source), null, 'profile', array(), 'any', false, false, false, 24)
     (var/cache/prod/twig/dc/dce97559751d9e00cc4c9c5093ed4c113aedbcd5e9f25552c213a42a8d75184f.php:115)
  at __TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8->block_body(array('vacancy' => null, 'app' => object(AppVariable), 'language' => 'nl', 'ga_tracking' => 'UA-1233549-2'), array('stylesheets' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_body'), 'javascript' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_javascript')))
     (vendor/twig/twig/src/Template.php:184)
  at Twig\Template->displayBlock('body', array('vacancy' => null, 'app' => object(AppVariable), 'language' => 'nl', 'ga_tracking' => 'UA-1233549-2'), array('stylesheets' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_body'), 'javascript' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_javascript')))
     (var/cache/prod/twig/db/db50141d9acc276943efec615d583af9f99c9ce01e69bc3ed4321d451dfb769c.php:113)
  at __TwigTemplate_7225eee8b98ba5fbdf32a89b29a46d748a6b3091f1f2de3dadcbfd9badb17ba8->doDisplay(array('vacancy' => null, 'app' => object(AppVariable), 'language' => 'nl', 'ga_tracking' => 'UA-1233549-2'), array('stylesheets' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_body'), 'javascript' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_javascript')))
     (vendor/twig/twig/src/Template.php:407)
  at Twig\Template->displayWithErrorHandling(array('vacancy' => null, 'app' => object(AppVariable), 'language' => 'nl', 'ga_tracking' => 'UA-1233549-2'), array('stylesheets' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_body'), 'javascript' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_javascript')))
     (vendor/twig/twig/src/Template.php:380)
  at Twig\Template->display(array('vacancy' => null, 'app' => object(AppVariable), 'language' => 'nl', 'ga_tracking' => 'UA-1233549-2'), array('stylesheets' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_stylesheets'), 'javascript' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_javascript'), 'body' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_body')))
     (var/cache/prod/twig/dc/dce97559751d9e00cc4c9c5093ed4c113aedbcd5e9f25552c213a42a8d75184f.php:47)
  at __TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8->doDisplay(array('vacancy' => null, 'app' => object(AppVariable), 'language' => 'nl', 'ga_tracking' => 'UA-1233549-2'), array('stylesheets' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_stylesheets'), 'javascript' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_javascript'), 'body' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_body')))
     (vendor/twig/twig/src/Template.php:407)
  at Twig\Template->displayWithErrorHandling(array('vacancy' => null, 'app' => object(AppVariable), 'language' => 'nl', 'ga_tracking' => 'UA-1233549-2'), array('stylesheets' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_stylesheets'), 'javascript' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_javascript'), 'body' => array(object(__TwigTemplate_fd1b5176b0f2e318f0b1fd45ce897408de145d21080ca6223a7a0be63173c2c8), 'block_body')))
     (vendor/twig/twig/src/Template.php:380)
  at Twig\Template->display(array('vacancy' => null))
     (vendor/twig/twig/src/Template.php:392)
  at Twig\Template->render(array('vacancy' => null), array())
     (vendor/twig/twig/src/TemplateWrapper.php:45)
  at Twig\TemplateWrapper->render(array('vacancy' => null))
     (vendor/twig/twig/src/Environment.php:318)
  at Twig\Environment->render('index/vacancy.html.twig', array('vacancy' => null))
     (vendor/symfony/framework-bundle/Controller/ControllerTrait.php:233)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render('index/vacancy.html.twig', array('vacancy' => null))
     (src/Controller/IndexController.php:47)
  at App\Controller\IndexController->vacancy(object(Request), object(EntityManager))
     (vendor/symfony/http-kernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:198)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:25)