diff --git a/mail_inline_css/models/mail_template.py b/mail_inline_css/models/mail_template.py index a7e5d9032..c45e00811 100644 --- a/mail_inline_css/models/mail_template.py +++ b/mail_inline_css/models/mail_template.py @@ -28,6 +28,8 @@ class MailTemplate(models.Model): return result def _premailer_apply_transform(self, data_html): + if not data_html: + return data_html premailer = Premailer(html=data_html, **self._get_premailer_options()) return premailer.transform()