Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: handle invalid img_id format in chunk update (#12422)

lif81f9296d790e
diff --git a/api/apps/chunk_app.py b/api/apps/chunk_app.py
index 00580b9589..d902fa2612 100644
--- a/api/apps/chunk_app.py
+++ b/api/apps/chunk_app.py
@@ -178,8 +178,9 @@ async def set():
# update image
image_base64 = req.get("image_base64", None)
- if image_base64:
- bkt, name = req.get("img_id", "-").split("-")
+ img_id = req.get("img_id", "")
+ if image_base64 and img_id and "-" in img_id:
+ bkt, name = img_id.split("-", 1)
image_binary = base64.b64decode(image_base64)
settings.STORAGE_IMPL.put(bkt, name, image_binary)
return get_json_result(data=True)