3.1.2 Utils.js file
Open
Nobody has claimed this yet.
Bug
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 40
Description
believe the following code should be reversed for left to right precedence to catch nulls before attempting to test length on null.
if (reply.length === 0 || !(reply instanceof Array)) {
return null;
}
should be
if (!(reply instanceof Array) || reply.length === 0) {
return null;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open v3.1/lib/utils.js at line 5 and inspect the conditional described in the issue. Confirm how null and non-array replies are handled before accessing length. Done means null inputs no longer cause a length access error while existing array handling remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100