title: Symfony 5 object not found by the @ParamConverter annotation and 404 redirection
body: <p>I want to redirect users to a 404 page.</p>
  <p>My problem is that if the slug does not exist I get an error:</p>
  <p><strong>App\Entity\Article object not found by the @ParamConverter annotation.</strong></p>
  <p>Unfortunately I can't find a way to get the NULL for the condition.</p>
  <pre class="lang-php prettyprint-override"><code>/**
  * @Route(&quot;/rubriques/{slugCategory}/{slug}&quot;, name=&quot;articleSingle&quot;)
  */
  public function show(Article $article, String $slug): Response
  {
    $article = $this-&gt;repoArticle-&gt;findOneBy(['slug' =&gt; $slug]);
  
    dd($article);
  
    if (!$article) {
        return $this-&gt;redirectToRoute('404error');
    }
  
    return $this-&gt;render(&quot;show/index.html.twig&quot;, [
        'article' =&gt; $article,
    ]);
  }
  </code></pre>