From cc5f3ee44ad79481831d7cf8c60f8db2dc631651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AF=BB=E9=9B=BE=E5=90=AF=E7=A4=BA?= Date: Thu, 5 Jun 2025 17:13:58 +0800 Subject: [PATCH] fix: add judge of empty args empty args will be handle as empty string like [''] some mcp server will report error --- frontend/src/views/SoftSettings/controller/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/SoftSettings/controller/index.tsx b/frontend/src/views/SoftSettings/controller/index.tsx index 8099d91..de1ae7b 100644 --- a/frontend/src/views/SoftSettings/controller/index.tsx +++ b/frontend/src/views/SoftSettings/controller/index.tsx @@ -220,7 +220,11 @@ function formatEnv(val: Record) { * @returns {string[]} 恢复后的参数值 */ function receveArgs(val: string) { - return val.split('\n'); + if (val) { + return val.split('\n'); + } else { + return [] + } } /** * @description 恢复环境变量 @@ -492,4 +496,4 @@ export async function saveMcpConfigFile(obj: Record) { } else { message.error(res.msg!); } -} \ No newline at end of file +}