title: Symfony 4.3 - Argument 1 passed to App\Entity\BlogPost::setTitle() must be of the type string, null given
body: <p>I am developing simple blog with Symfony 4.3. And then when I add a new post , I found this error: </p>
  
  <pre><code>Argument 1 passed to App\Entity\BlogPost::setTitle() must be of the type string, null given, called in C:\wamp64\www\symfony4\src\Controller\BlogPostController.php on line 99
  </code></pre>
  
  <p>My function see below here:</p>
  
  <pre><code>
      public function add(Request $request, EntityManagerInterface $entityManager)
          {
  
              $form = $this-&gt;createForm(BlogPostType::class);
  
              $form-&gt;handleRequest($request);
  
              if ($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()) {
  
                  $blogPost = new BlogPost();
                  $blogPost-&gt;setTitle($request-&gt;request-&gt;get('title'));
                  $blogPost-&gt;setContent($request-&gt;request-&gt;get('content'));
                  $blogPost-&gt;setPublishedAt(new \DateTime());
                  $blogPost-&gt;setUser($this-&gt;getUser());
  
                  $entityManager-&gt;persist($blogPost);
                  $entityManager-&gt;flush();
  
                return new RedirectResponse($this-&gt;router-&gt;generate('blog_post_index'));
              }
  
              return new Response(
                  $this-&gt;twig-&gt;render(
                      'blog_post/add.html.twig',
                      ['blogPostForm' =&gt; $form-&gt;createView()]
                  )
              );
          }
  </code></pre>
  
  <p>So can I set the title and content?
  Thanks</p>