Skip to content

fix(ui): guard against empty plugin prop on connection creation page#8918

Merged
klesh merged 1 commit into
apache:mainfrom
bujjibabukatta:fix/#8914
Jun 12, 2026
Merged

fix(ui): guard against empty plugin prop on connection creation page#8918
klesh merged 1 commit into
apache:mainfrom
bujjibabukatta:fix/#8914

Conversation

@bujjibabukatta

Copy link
Copy Markdown
Contributor

Summary

Fixes #8914

What happened

When clicking "New Connection" from the connection list modal, the plugin
state was still an empty string '' when ConnectionForm rendered. This
caused getPluginConfig('') to return a fallback config with an empty name,
leading to:

TypeError: Cannot read properties of undefined (reading 'name')

Root Cause

In connections.tsx, handleShowFormDialog set type = 'form' but did
not ensure plugin was set. The form modal only checked pluginConfig but
not plugin itself, so ConnectionForm received an empty string as the
plugin prop.

Changes

config-ui/src/routes/connection/connections.tsx

  • Added plugin && guard to the form modal condition to prevent
    ConnectionForm from rendering with an empty plugin

config-ui/src/plugins/components/connection-form/index.tsx

  • Added ?? {} fallback on getPluginConfig destructuring
  • Added if (!plugin || !name) return null guard after all hooks
    as a defensive measure

How to Test

  1. Take the latest main branch
  2. Navigate to the Connections page
  3. Click on any data source plugin
  4. Click "New Connection" in the list modal
  5. The connection creation form should open correctly without errors

@veetmoradiya3628 veetmoradiya3628 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@klesh klesh merged commit 33f7d34 into apache:main Jun 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][UI] Few connection creation page is broken

3 participants