2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-23 13:16:30 +00:00

Prevent name check on null attachment file (#3819)

(cherry picked from commit c4ed1e23a01f278d696c2853337bdde0a682c6c5)
(cherry picked from commit 8c2d89de20)
This commit is contained in:
Oliver
2022-10-20 21:53:25 +11:00
committed by GitHub
parent 531c39725c
commit ca1fbf9ff0

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)