From d027e51faad3c54d56c7762baccb0fa0047c95e6 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 17 Feb 2023 16:21:12 +0200 Subject: [PATCH] fix 500 error --- files/routes/settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)