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
  • Loading branch information
martinslota committed Jun 10, 2024
1 parent 6dd8e06 commit 3d6cc5a
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 3d6cc5a

Please sign in to comment.