From f5c8bfad9b3ee07d31dda945bc71c98d52b86e80 Mon Sep 17 00:00:00 2001 From: Shashwati Bhattacharyaa <166847329+shashbha14@users.noreply.github.com> Date: Wed, 13 May 2026 01:39:31 +0530 Subject: [PATCH] [v3-2-test] Fix ConnectionForm crashing when connection has invalid extra JSON (#66593) (cherry picked from commit bd2c948498aa403c18468f86e2a8912addd2dbbb) Co-authored-by: Shashwati Bhattacharyaa <166847329+shashbha14@users.noreply.github.com> Co-authored-by: Shashwati --- .../src/airflow/ui/src/pages/Connections/ConnectionForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx b/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx index 55194ed3a2325..af46f0ae3d40d 100644 --- a/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx +++ b/airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx @@ -82,7 +82,11 @@ const ConnectionForm = ({ setValue("conn_type", selectedConnType, { shouldDirty: true, }); - setConf(JSON.stringify(JSON.parse(initialConnection.extra), undefined, 2)); + try { + setConf(JSON.stringify(JSON.parse(initialConnection.extra), undefined, 2)); + } catch { + setConf(initialConnection.extra); + } }, [selectedConnType, initialConnection, setConf, setValue]); // Automatically reset form when conf is fetched