title: FatalErrorException: Call to a member function getFirstName() on null
body: <p>Please help me</p>
  
  <blockquote>
    <p>in C:\xampp\htdocs\project_sms\src\Com\AkSolutions\Sms\UserBundle\Form\Type\UserSendMessageType.php at line 55</p>
  </blockquote>
  
  <pre><code>$form = $event-&gt;getForm();
  $form-&gt;getData()-&gt;setFromUserId($this-&gt;user-&gt;getId());
  $form-&gt;getData()-&gt;setFromName($this-&gt;userProfile-&gt;getFirstName()."".$this-&gt;userProfile-&gt;getLastName());
  $form-&gt;getData()-&gt;setUserType($this-&gt;userType);
  $form-&gt;getData()-&gt;setReadStatus(false);
  $form-&gt;getData()-&gt;setDeleteStatus(false); 
  </code></pre>