XF 2.2 Call to a member function has() on null


Well-known member
Recently switched servers and this has been popping up a few times a day on a private development board.

Server error log
Error: Call to a member function has() on null src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php:589
Generated by: Unknown account Sep 2, 2020 at 6:28 PM
Stack trace
#0 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php(336): Swift_Mime_SimpleMimeEntity->getHeaderFieldModel('To')
#1 src/XF/Mail/Mailer.php(274): Swift_Mime_SimpleMessage->getTo()
#2 src/XF/Mail/Queue.php(138): XF\Mail\Mailer->send(Object(Swift_Message), NULL, Array)
#3 src/XF/Job/MailQueue.php(12): XF\Mail\Queue->run(G)
#4 src/XF/Job/Manager.php(258): XF\Job\MailQueue->run(G)
#5 src/XF/Job/Manager.php(200): XF\Job\Manager->runJobInternal(Array, G)
#6 src/XF/Job/Manager.php(84): XF\Job\Manager->runJobEntry(Array, G)
#7 job.php(43): XF\Job\Manager->runQueue(false, 8)
#8 {main}
Request state
array(4) {
  ["url"] => string(15) "/ forums /job.php"
  ["referrer"] => string(79) "https://community.com/forums/admin.php?styles/stylename.519/style-properties"
  ["_GET"] => array(0) {
  ["_POST"] => array(0) {

Any thoughts?
Last edited:


Well-known member
I've had random test accounts created over the years with no email address assigned to them for various testing purposes but it was never an issue.

What's strange is that this error will generate if I don't visit the site for a bit (30 minutes) and if I browse directly to like the admin page, it'll throw the error and show the referrer as the admin.php link.


XenForo moderator
Staff member
Yes, it's possible to have accounts with no email address and in those cases, the system wouldn't attempt to send an email.

I don't really know what is triggering this particular error - I have never seen it on any forum I have been involved with over the years.

Joao Prates


I've upgraded my site to 2.2 today and immediately started getting these pesky errors.
The site was running fine with no errors whatsoever prior to the upgrade, and no new accounts have been created today.

Can you please collaborate with me to diagnose the source problem, and if it's a but to release a quick fix asap?