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: Makes the code more defensive to prevent an error. (#7837)

George Politis5939820271b2
diff --git a/react/features/connection-indicator/components/web/ConnectionIndicator.js b/react/features/connection-indicator/components/web/ConnectionIndicator.js
index 8e86b1e2c4..eb76219850 100644
--- a/react/features/connection-indicator/components/web/ConnectionIndicator.js
+++ b/react/features/connection-indicator/components/web/ConnectionIndicator.js
@@ -435,16 +435,20 @@ export function _mapDispatchToProps(dispatch: Dispatch<any>) {
*/
export function _mapStateToProps(state: Object, ownProps: Props) {
- const firstVideoTrack = getTrackByMediaTypeAndParticipant(
- state['features/base/tracks'], MEDIA_TYPE.VIDEO, ownProps.participantId);
- const firstAudioTrack = getTrackByMediaTypeAndParticipant(
- state['features/base/tracks'], MEDIA_TYPE.AUDIO, ownProps.participantId);
+ const conference = state['features/base/conference'].conference;
- return {
- audioSsrc: firstAudioTrack
- ? state['features/base/conference'].conference.getSsrcByTrack(firstAudioTrack.jitsiTrack) : undefined,
- videoSsrc: firstVideoTrack
- ? state['features/base/conference'].conference.getSsrcByTrack(firstVideoTrack.jitsiTrack) : undefined
- };
+ if (conference) {
+ const firstVideoTrack = getTrackByMediaTypeAndParticipant(
+ state['features/base/tracks'], MEDIA_TYPE.VIDEO, ownProps.participantId);
+ const firstAudioTrack = getTrackByMediaTypeAndParticipant(
+ state['features/base/tracks'], MEDIA_TYPE.AUDIO, ownProps.participantId);
+
+ return {
+ audioSsrc: firstAudioTrack ? conference.getSsrcByTrack(firstAudioTrack.jitsiTrack) : undefined,
+ videoSsrc: firstVideoTrack ? conference.getSsrcByTrack(firstVideoTrack.jitsiTrack) : undefined
+ };
+ }
+
+ return {};
}
export default translate(connect(_mapStateToProps, _mapDispatchToProps)(ConnectionIndicator));