Skip to content

Commit

Permalink
test: check that condition is defined before we access it (#1701)
Browse files Browse the repository at this point in the history
  • Loading branch information
Just-Sieb authored and luin committed Apr 15, 2023
1 parent ecc44b6 commit f44642c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class Redis extends Commander {
get mode(): "normal" | "subscriber" | "monitor" {
return this.options.monitor
? "monitor"
: this.condition.subscriber
: this.condition && this.condition.subscriber
? "subscriber"
: "normal";
}
Expand Down

0 comments on commit f44642c

Please sign in to comment.