fix(api): prevent NoneType error by adding empty parent_message object

This commit is contained in:
cogwheel
2025-12-22 07:59:57 +05:30
parent b8dfd68e00
commit 4559b8fa1a
2 changed files with 6 additions and 1 deletions

View File

@@ -3292,6 +3292,11 @@ class ApiService {
data['parent_id'] = parentMessageId; data['parent_id'] = parentMessageId;
} }
// Always include parent_message as empty object to prevent NoneType error in OWUI 0.6.42+
// The server code does: parent_message.get("files", []) which fails if parent_message is None
// See: https://github.com/cogwheel0/conduit/issues/311
data['parent_message'] = <String, dynamic>{};
// Attach background_tasks if provided // Attach background_tasks if provided
if (backgroundTasks != null && backgroundTasks.isNotEmpty) { if (backgroundTasks != null && backgroundTasks.isNotEmpty) {
data['background_tasks'] = backgroundTasks; data['background_tasks'] = backgroundTasks;