Skip to content

Commit

Permalink
Do not fail when retrieving a node by non-existing key
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Slota <[email protected]>
  • Loading branch information
martinslota committed Jun 10, 2024
1 parent 6536e22 commit 158c64c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cluster/ConnectionPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class ConnectionPool extends EventEmitter {
}

getInstanceByKey(key: NodeKey): Redis {
return this.nodeRecords.all[key].redis;
return this.nodeRecords.all[key]?.redis;
}

getSampleInstance(role: NodeRole): Redis {
Expand Down

0 comments on commit 158c64c

Please sign in to comment.