diff --git a/yadc/models.py b/yadc/models.py index f3af26e..77c41fc 100644 --- a/yadc/models.py +++ b/yadc/models.py @@ -243,7 +243,10 @@ class Post(TimestampMixin, db.Model): def remove_image_files(self): for im in self.image_files.values(): - os.remove(im) + try: + if im: os.remove(im) + except: + pass @property def image_files(self):