binding makes no difference - put a null check in to catch the rogue exception

This commit is contained in:
David Baker 2015-10-20 17:46:11 +01:00
parent da6c5653b1
commit fe0707535c
1 changed files with 4 additions and 1 deletions

View File

@ -27,7 +27,7 @@ module.exports = React.createClass({
mixins: [VideoViewController], mixins: [VideoViewController],
componentWillMount: function() { componentWillMount: function() {
dis.register(this.onAction.bind(this)); dis.register(this.onAction);
}, },
getRemoteVideoElement: function() { getRemoteVideoElement: function() {
@ -41,6 +41,9 @@ module.exports = React.createClass({
onAction: function(payload) { onAction: function(payload) {
switch (payload.action) { switch (payload.action) {
case 'video_fullscreen': case 'video_fullscreen':
if (!this.refs.container) {
return;
}
var element = this.refs.container.getDOMNode(); var element = this.refs.container.getDOMNode();
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen; var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
requestMethod.call(element); requestMethod.call(element);