From 480854456a14e3e126a40797cb1b8d3c3beddd68 Mon Sep 17 00:00:00 2001 From: CH3CHO Date: Thu, 12 Dec 2024 22:43:31 +0800 Subject: [PATCH] fix: Fix the undefined schema issue when configuring custom plugins --- .../plugin/components/PluginDrawer/GlobalPluginDetail.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/plugin/components/PluginDrawer/GlobalPluginDetail.tsx b/frontend/src/pages/plugin/components/PluginDrawer/GlobalPluginDetail.tsx index e1ff74db..b928b5cd 100644 --- a/frontend/src/pages/plugin/components/PluginDrawer/GlobalPluginDetail.tsx +++ b/frontend/src/pages/plugin/components/PluginDrawer/GlobalPluginDetail.tsx @@ -105,11 +105,11 @@ const GlobalPluginDetail = forwardRef((props: IProps, ref) => { onSuccess: (res) => { setConfigData(res); setSchema(res.schema); - if (!res.schema.jsonSchema.properties) { + if (!res.schema?.jsonSchema?.properties) { setCurrentTabKey('yaml'); } if (!defaultValue) { - let exampleRaw = res?.schema?.extensions['x-example-raw']; + let exampleRaw = res.schema?.extensions ? res.schema.extensions['x-example-raw'] : ''; if (isChangeExampleRaw) { // Need a space after the colon exampleRaw = 'allow: []';