Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(hangup): truthy check for deviceChangeListener before removing it (#3235)

virtuacoplenny485ff81443fe
diff --git a/conference.js b/conference.js
index 45a8728ce8..f6e10fa14b 100644
--- a/conference.js
+++ b/conference.js
@@ -2479,9 +2479,11 @@ export default {
APP.UI.removeLocalMedia();
// Remove unnecessary event listeners from firing callbacks.
- JitsiMeetJS.mediaDevices.removeEventListener(
- JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED,
- this.deviceChangeListener);
+ if (this.deviceChangeListener) {
+ JitsiMeetJS.mediaDevices.removeEventListener(
+ JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED,
+ this.deviceChangeListener);
+ }
let requestFeedbackPromise;