title: Symfony 4 Notice: Trying to access array offset on value of type null
body: <p>I got a project on Symfony 4, since i install that project on my new computer with the latest version of PHP 7.4, i have an error on some query but not in all my controller.</p>
  <p>Heres the method in the controller</p>
  <pre><code>/**
   * @Route(&quot;/juge/{userId}/jugementCategorie/{id}&quot;, name=&quot;jugementCategorie&quot;)
   */
  public function jugementCategorie($id, $userId, CategorieRepository $repoCat, ResultatRepository $repoResult, KaratekaRepository $repoKarateka)
  {
  
      $actif = [];
  
      $categorie = $repoCat-&gt;find($id);
      $karatekas = $categorie-&gt;getKarateka();
  
      $resultats = $repoResult-&gt;findResultatCategorieJuge($id, $userId);
      $activeKarateka = $repoKarateka-&gt;findByActiveInCat($id);
      
      if(isset($activeKarateka)){
          $count = 0;
          foreach($activeKarateka-&gt;getResultats() as $resultat){
              if($resultat-&gt;getUser()-&gt;getId() == $userId &amp;&amp; $resultat-&gt;getCategorie()-&gt;getId() == $id){
                  $count++;                   
              }        
          }
          if($count == 0){
              $actif = $activeKarateka;
          }
      }
          
      return $this-&gt;render('juge/jugementCategorie.html.twig', [
          'categorieId' =&gt; $id,
          'actif' =&gt; $actif,
          'resultats' =&gt; $resultats,
      ]);
  }
  </code></pre>
  <p>When i try to access this page i have this error</p>
  <p><a href="https://i.stack.imgur.com/eZh7Y.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eZh7Y.jpg" alt="enter image description here" /></a></p>
  <p>I got some ajax call that are not working when calling methods in that specific controller too.</p>