Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function fetchCapabilitiesFromAdapter(
}

// eslint-disable-next-line security/detect-object-injection
const getter = directLine[getterName];
const getter = directLine?.[getterName];
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

The optional chaining is a good defensive fix, but the function's type signature on line 16 still declares directLine: DirectLineJSBotConnection (non-nullable). This means TypeScript won't flag callers that pass a non-null value, and the optional chaining here will appear unnecessary to anyone reading the types. Consider updating the parameter type to directLine: DirectLineJSBotConnection | undefined (or directLine?: DirectLineJSBotConnection) so that the type signature accurately reflects that directLine may be nullish. This also aligns with WebChatAPIContext.ts line 31 where directLine is already typed as optional.

Copilot uses AI. Check for mistakes.

if (typeof getter === 'function') {
try {
Expand Down
Loading