Skip to content

Conversation

medcl
Copy link
Member

@medcl medcl commented Oct 7, 2025

What does this PR do

This pull request makes minor improvements across several files to ensure safer handling of potentially undefined or null string values by adding optional chaining (?.) before string method calls like replace. This change helps prevent runtime errors if the target of the method is not defined.

The most important changes include:

Safer string replacement operations:

  • Added optional chaining (?.) before replace method calls in various functions to prevent errors when the target string might be undefined or null, affecting files such as proxy.ts, DocSearch.jsx, utils.ts, and Markdown.jsx. [1] [2] [3] [4] [5] [6]

Rationale for this change

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@ayangweb ayangweb merged commit ce8b461 into main Oct 9, 2025
7 checks passed
@ayangweb ayangweb deleted the safet_access branch October 9, 2025 07:07
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.

3 participants