Skip to content

Commit 0c0ec30

Browse files
authored
test: check that condition is defined before we access it (#1701)
1 parent 9af7b1c commit 0c0ec30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Redis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ class Redis extends Commander {
347347
get mode(): "normal" | "subscriber" | "monitor" {
348348
return this.options.monitor
349349
? "monitor"
350-
: this.condition.subscriber
350+
: this.condition && this.condition.subscriber
351351
? "subscriber"
352352
: "normal";
353353
}

0 commit comments

Comments
 (0)