From db4596a8383eee7e167d7d9cc41dabdb9683118c Mon Sep 17 00:00:00 2001 From: Antonio Calapez Date: Tue, 23 Oct 2018 21:09:13 +0200 Subject: [PATCH] Throws an error when trying to access the clients of a dynamic namespace --- lib/namespace.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/namespace.js b/lib/namespace.js index 6d0ac17065..bca8a3e99f 100644 --- a/lib/namespace.js +++ b/lib/namespace.js @@ -262,6 +262,9 @@ Namespace.prototype.write = function(){ */ Namespace.prototype.clients = function(fn){ + if(!this.adapter){ + throw new Error('No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?') + } this.adapter.clients(this.rooms, fn); // reset rooms for scenario: // .in('room').clients() (GH-1978)