Call to a member function addError() on null

Created on 1 July 2025, 21 days ago

Problem/Motivation

When email sending throws an error, the following error occurs.
Error: Call to a member function addError() on null in Drupal\symfony_mailer\Mailer->doSend() (line 291 of /code/web/modules/contrib/symfony_mailer/src/Mailer.php).

Proposed resolution

$this->messenger is not initialized in the constructor. Use DI to initialize it.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇭🇺Hungary balagan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024