You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
chore: guard against inherited properties
This commit is contained in:
@@ -72,13 +72,15 @@ function onReady (client) {
|
||||
if (!client.options.disableResubscribing && callbackCount) {
|
||||
debug('Sending pub/sub onReady commands')
|
||||
for (const key in client.subscriptionSet) {
|
||||
const command = key.slice(0, key.indexOf('_'))
|
||||
const args = client.subscriptionSet[key]
|
||||
client[command]([args]).catch((err) => {
|
||||
if (!client.closing) {
|
||||
process.nextTick(() => client.emit('error', err))
|
||||
}
|
||||
})
|
||||
if (client.subscriptionSet.hasOwnProperty(key)) {
|
||||
const command = key.slice(0, key.indexOf('_'))
|
||||
const args = client.subscriptionSet[key]
|
||||
client[command]([args]).catch((err) => {
|
||||
if (!client.closing) {
|
||||
process.nextTick(() => client.emit('error', err))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
client.sendOfflineQueue()
|
||||
|
Reference in New Issue
Block a user