aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patchwork/models.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/patchwork/models.py b/patchwork/models.py
index be71d40..08ee341 100644
--- a/patchwork/models.py
+++ b/patchwork/models.py
@@ -347,7 +347,9 @@ class EmailMixin(models.Model):
# message content to '\r\n'. We need to fix them to avoid problems,
# especially as git complains about malformed patches when PW runs
# on PY2
- self.content = self.content.replace('\r\n', '\n')
+ if self.content:
+ self.content = self.content.replace('\r\n', '\n')
+
super(EmailMixin, self).save(*args, **kwargs)
class Meta: