Skip to content

fix(enterprise): guard against null domains and trim whitespace in HRD screen - #2841

Open
ankita10119 wants to merge 2 commits into
v13from
SDK-10306-2
Open

fix(enterprise): guard against null domains and trim whitespace in HRD screen#2841
ankita10119 wants to merge 2 commits into
v13from
SDK-10306-2

Conversation

@ankita10119

Copy link
Copy Markdown
Contributor

Changes

connection/enterprise.js

  • matchConnection: added null guard on x.get('domains') before calling .contains() - prevents a crash when a connection has no domains configured
  • findADConnectionWithoutDomain: same null guard before calling .isEmpty()

connection/enterprise/hrd_screen.jsx

  • Changed domain !== null to domain && domain.trim() - empty or whitespace-only domain strings now fall back to the generic login instructions instead of interpolating a blank value into the enterprise instructions string

References

Testing

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of the platform/language

New test file matchConnection.test.js covers:

  • Matching a connection by email domain
  • No match when domain differs
  • No throw when a connection has null domains
  • Returns false for an email with no domain part

hrd_screen.test.js adds two new cases:

  • Empty string domain falls back to generic instructions
  • Whitespace-only domain falls back to generic instructions

All 407 tests pass.

Checklist

@ankita10119
ankita10119 requested a review from a team as a code owner July 21, 2026 17:57
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.

1 participant