From 4eb9a798ed1c71d9435337a6f973adb8b7dc6541 Mon Sep 17 00:00:00 2001 From: Suguru Motegi Date: Thu, 27 Feb 2020 22:36:29 -0800 Subject: [PATCH] Check bulk reply type strictly (#51) --- redis.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redis.ts b/redis.ts index 025b8b4c..a9d7c338 100644 --- a/redis.ts +++ b/redis.ts @@ -525,7 +525,8 @@ class RedisImpl implements Redis { ...args: (string | number)[] ): Promise { const [_, reply] = await this.executor.execRawReply(command, ...args); - if (typeof reply !== "string" && reply != null) { + // Note: `reply != null` won't work when `strict` is false #50 + if (typeof reply !== "string" && typeof reply !== 'undefined') { throw new Error(); } return reply;