From 2880ff8275e2616d75b9b11615183366bd5e0da8 Mon Sep 17 00:00:00 2001 From: vibhor goel <158250836+ac-vibhor@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:54:44 +0530 Subject: [PATCH] fix empty string base64 (#32) --- web-agent/app/worker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web-agent/app/worker.py b/web-agent/app/worker.py index 3bd39a3..343b69b 100644 --- a/web-agent/app/worker.py +++ b/web-agent/app/worker.py @@ -311,6 +311,8 @@ def process_task(task: Dict[str, Any]) -> Dict[str, Any]: logger.info("Data is less than %s, sending data in response", max_file_size) with open(temp_output_file.name, 'rb') as file: file_data = file.read() + if len(file_data) == 0: + return task base64_string = base64.b64encode(file_data).decode('utf-8') task['responseBase64'] = True task['output'] = base64_string