Skip to content

Commit

Permalink
fix: prevent exception when send custom command
Browse files Browse the repository at this point in the history
When send command not in `redis-commands`, it may raise
exception 'Unknown command' when `status` not 'ready'.
  • Loading branch information
liukun authored and luin committed Dec 25, 2019
1 parent 0e7090a commit 04cad7f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/redis/index.ts
Expand Up @@ -663,6 +663,7 @@ Redis.prototype.sendCommand = function(command, stream) {
this.status === "ready" ||
(!stream &&
this.status === "connect" &&
commands.exists(command.name) &&
commands.hasFlag(command.name, "loading"));
if (!this.stream) {
writable = false;
Expand Down

0 comments on commit 04cad7f

Please sign in to comment.