symfony 2.5 - fatalerroreexception:在null时调用成员函数getFirstName(



请帮帮我

in C:xampphtdocsproject_smssrcComAkSolutionsSmsUserBundleFormTypeUserSendMessageType.php at line 55

$form = $event->getForm();
$form->getData()->setFromUserId($this->user->getId());
$form->getData()->setFromName($this->userProfile->getFirstName()."".$this->userProfile->getLastName());
$form->getData()->setUserType($this->userType);
$form->getData()->setReadStatus(false);
$form->getData()->setDeleteStatus(false); 

问题似乎在这里:

$this->userProfile->getFirstName()

特别是错误告诉你这个表达式:

$this->userProfile

是null

相关内容

  • 没有找到相关文章

最新更新