diff --git a/backend/routes/profiles.py b/backend/routes/profiles.py index 054fe4aa..429572f1 100644 --- a/backend/routes/profiles.py +++ b/backend/routes/profiles.py @@ -232,7 +232,7 @@ async def upload_profile_avatar( db: Session = Depends(get_db), ): """Upload or update avatar image for a profile.""" - with tempfile.NamedTemporaryFile(delete=False, suffix=Path(file.filename).suffix) as tmp: + with tempfile.NamedTemporaryFile(delete=False, suffix=Path(file.filename or "").suffix) as tmp: content = await file.read() tmp.write(content) tmp_path = tmp.name