check for profile background existence before atttempting to delete

pull/55/head
Aevann1 2022-12-08 07:20:34 +02:00
parent 0a915aae08
commit 0d812f1294
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ def upload_profile_background(v):
background = process_image(name, v)
if background:
if v.profile_background:
if v.profile_background and path.isfile(profile_background):
os.remove(v.profile_background)
v.profile_background = background
g.db.add(v)