2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Prevent name check on null attachment file

(cherry picked from commit c4ed1e23a01f278d696c2853337bdde0a682c6c5)
This commit is contained in:
Oliver Walters
2022-10-20 21:11:00 +11:00
parent 906ae218aa
commit 8c2d89de20

View File

@ -385,7 +385,7 @@ class InvenTreeAttachment(models.Model):
'link': _('Missing external link'),
})
if self.attachment.name.lower().endswith('.svg'):
if self.attachment and self.attachment.name.lower().endswith('.svg'):
self.attachment.file.file = self.clean_svg(self.attachment)
super().save(*args, **kwargs)