redis / redis/node-redis

3.1.2 Utils.js file

Open
#1,677 3 comments 0 reactions 0 assignees View on GitHub

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;
}

bug

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.