diff --git a/files/routes/settings.py b/files/routes/settings.py index 5429022e1..b42657201 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -526,11 +526,12 @@ def settings_images_profile(v): if not imageurl: abort(400) - if v.highres and '/images/' in v.highres: + if v.highres and '/images/' in v.highres and path.isfile(v.highres): os.remove(v.highres) - if v.profileurl and '/images/' in v.profileurl: + if v.profileurl and '/images/' in v.profileurl and path.isfile(v.profileurl): os.remove(v.profileurl) + v.highres = highres v.profileurl = imageurl g.db.add(v)