🥅 Handle missing image file deletion

This commit is contained in:
itskovacs 2025-07-23 18:18:41 +02:00
parent 59af998b2f
commit 77cb4a0c1b

View File

@ -34,7 +34,10 @@ def b64img_decode(data: str) -> bytes:
def remove_image(path: str):
try:
Path(assets_folder_path() / path).unlink()
fpath = Path(assets_folder_path() / path)
if not fpath.exists():
return
fpath.unlink()
except OSError as exc:
raise Exception("Error deleting image:", exc, path)