From 5d958ed283d1ee006e34d2b07313db7410d72464 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Thu, 9 Oct 2025 18:38:33 +0200 Subject: [PATCH] Fix backend_options cleanup to exclude empty arrays in InstanceDialog --- webui/src/components/InstanceDialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webui/src/components/InstanceDialog.tsx b/webui/src/components/InstanceDialog.tsx index d9b731c..324f694 100644 --- a/webui/src/components/InstanceDialog.tsx +++ b/webui/src/components/InstanceDialog.tsx @@ -106,7 +106,7 @@ const InstanceDialog: React.FC = ({ // Clean up undefined values to avoid sending empty fields const cleanOptions: CreateInstanceOptions = {}; Object.entries(formData).forEach(([key, value]) => { - if (key === 'backend_options' && value && typeof value === 'object') { + if (key === 'backend_options' && value && typeof value === 'object' && !Array.isArray(value)) { // Handle backend_options specially - clean nested object const cleanBackendOptions: any = {}; Object.entries(value).forEach(([backendKey, backendValue]) => { @@ -118,7 +118,7 @@ const InstanceDialog: React.FC = ({ cleanBackendOptions[backendKey] = backendValue; } }); - + // Only include backend_options if it has content if (Object.keys(cleanBackendOptions).length > 0) { (cleanOptions as any)[key] = cleanBackendOptions;