From f616b0b71b592d176b159b65783b9b2452d7a628 Mon Sep 17 00:00:00 2001 From: bbaldino Date: Mon, 28 Aug 2017 21:49:24 +0000 Subject: [PATCH] few tweaks to fix some exceptions in edge --- modules/UI/videolayout/VideoContainer.js | 9 ++++++--- .../connection-stats/components/ConnectionStatsTable.js | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/UI/videolayout/VideoContainer.js b/modules/UI/videolayout/VideoContainer.js index 1211ebf8e..021cd28db 100644 --- a/modules/UI/videolayout/VideoContainer.js +++ b/modules/UI/videolayout/VideoContainer.js @@ -626,8 +626,11 @@ export class VideoContainer extends LargeContainer { // the environment words the report. To reduce the risk of scaring a // developer, make sure that the rejection is handled. We cannot really // do anything substantial about the rejection and, more importantly, we - // do not care. - this.$videoBackground[0].play() - .catch(reason => logger.error(reason)); + // do not care. Some browsers (at this time, only Edge is known) don't + // return a promise from .play(), so check before trying to catch. + const res = this.$videoBackground[0].play(); + if (typeof res !== 'undefined') { + res.catch(reason => logger.error(reason)); + } } } diff --git a/react/features/connection-stats/components/ConnectionStatsTable.js b/react/features/connection-stats/components/ConnectionStatsTable.js index 2de2ed66f..f017f63c6 100644 --- a/react/features/connection-stats/components/ConnectionStatsTable.js +++ b/react/features/connection-stats/components/ConnectionStatsTable.js @@ -476,6 +476,10 @@ class ConnectionStatsTable extends Component { * @returns {string} */ function getIP(value) { + if (!value) { + return ''; + } + return value.substring(0, value.lastIndexOf(':')); } @@ -488,6 +492,10 @@ function getIP(value) { * @returns {string} */ function getPort(value) { + if (!value) { + return ''; + } + return value.substring(value.lastIndexOf(':') + 1, value.length); }