1
0
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:
Ruben Bridgewater
2017-05-27 01:01:42 +02:00
parent e33a642994
commit 8cca9ccf58
4 changed files with 24 additions and 13 deletions

View File

@@ -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()