fix: separate duplicate erms validation in insertErms#67422
Merged
ojeytonwilliams merged 3 commits intoMay 15, 2026
Merged
Conversation
Contributor
|
Hi there, Thanks for opening this pull request. The automated checks found some issues: Linked Issue: We kindly ask that contributors open an issue before submitting a PR so the change can be discussed and approved before work begins. This helps avoid situations where significant effort goes into something we ultimately cannot merge. Please open an issue first and allow it to be triaged. Once the issue is open for contribution, you are welcome to update this pull request to reflect the issue consensus. Until then, we will not be able to review your pull request. Join us in our chat room or our forum if you have any questions or need help with contributing. |
ojeytonwilliams
requested changes
May 15, 2026
ojeytonwilliams
approved these changes
May 15, 2026
ojeytonwilliams
left a comment
Contributor
There was a problem hiding this comment.
LGTM 👍 Thanks, @Nithin0620
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist:
Description
This PR fixes a logic error in the
insertErmsfunction where duplicate error checks prevented the second validation from ever being reached.What changed:
if (!erms || erms.length <= 1)into two separate checksermsis providedermscontains at least 2 elementsWhy:
The original code had the second error check as unreachable dead code because the first condition would throw if
erms.length <= 1, so the second check could never execute.mainbranch of freeCodeCamp.Closes #67427