Skip to content

Commit

Permalink
Safer to check sub should be an object
Browse files Browse the repository at this point in the history
  • Loading branch information
gnought committed Aug 11, 2019
1 parent 5bc48bd commit 2df107b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/handlers/subscribe.js
Expand Up @@ -90,7 +90,7 @@ function blockDollarSignTopics (func) {
}

function storeSubscriptions (sub, done) {
if (!sub) {
if (!sub || typeof sub !== 'object') {
return done(null, null)
}

Expand All @@ -112,7 +112,7 @@ function storeSubscriptions (sub, done) {
}

function subTopic (sub, done) {
if (!sub) {
if (!sub || typeof sub !== 'object') {
this.granted = 128
return done()
}
Expand Down

0 comments on commit 2df107b

Please sign in to comment.