diff --git a/src/sessionControlClient.js b/src/sessionControlClient.js index 70d5054..76136d1 100644 --- a/src/sessionControlClient.js +++ b/src/sessionControlClient.js @@ -688,6 +688,13 @@ class SessionControlClient extends EventEmitter { return; } + if (midGroupList[midGroup].subscribe === undefined) { + let err = new Error(`[Session Control Client] [Subscribe] subscribing to midGroup [${midGroup}] is not supported`); + debug("SessionControlClient _subscribe err_unsupported_midGroup"); + cb(err); + return; + } + let mid = opts || {}; let type = SUBSCRIBE; @@ -748,6 +755,13 @@ class SessionControlClient extends EventEmitter { return; } + if (midGroupList[midGroup].unsubscribe === undefined) { + let err = new Error(`[Session Control Client] [Unsubscribe] unsubscribing from midGroup [${midGroup}] is not supported`); + debug("SessionControlClient _unsubscribe err_unsupported_midGroup"); + cb(err); + return; + } + if (cb === undefined) { if (typeof opts === "function") { cb = opts;