Skip to content

Commit 04cad7f

Browse files
liukunluin
authored andcommitted
fix: prevent exception when send custom command
When send command not in `redis-commands`, it may raise exception 'Unknown command' when `status` not 'ready'.
1 parent 0e7090a commit 04cad7f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/redis/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ Redis.prototype.sendCommand = function(command, stream) {
663663
this.status === "ready" ||
664664
(!stream &&
665665
this.status === "connect" &&
666+
commands.exists(command.name) &&
666667
commands.hasFlag(command.name, "loading"));
667668
if (!this.stream) {
668669
writable = false;

0 commit comments

Comments
 (0)