prevent 500 server error on a just removed folder when listing files (#3553)

This commit is contained in:
tobitege 2024-08-23 18:05:38 +02:00 committed by GitHub
parent 8d47cebde9
commit fc5f026942
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -605,10 +605,8 @@ if __name__ == '__main__':
full_path = os.path.join(client.initial_pwd, path)
if not os.path.exists(full_path):
return JSONResponse(
content={'error': f'Directory {full_path} does not exist'},
status_code=400,
)
# if user just removed a folder, prevent server error 500 in UI
return []
try:
# Check if the directory exists