mirror of https://github.com/OpenVidu/openvidu.git
Check for outboundStreamOpts before accessing it
This method should be the same as the others in regards to checking for valid property. It seems the extra logic for `isElectron` evaded the correct checking when calling from an incoming stream. Error reported: TypeError: Cannot read properties of undefined (reading 'publisherProperties') ```pull/688/head
parent
3c1876769b
commit
75b88175cb
|
@ -548,12 +548,15 @@ export class Stream {
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
isSendScreen(): boolean {
|
isSendScreen(): boolean {
|
||||||
|
if (!this.outboundStreamOpts) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let screen = this.outboundStreamOpts.publisherProperties.videoSource === 'screen';
|
let screen = this.outboundStreamOpts.publisherProperties.videoSource === 'screen';
|
||||||
if (platform.isElectron()) {
|
if (platform.isElectron()) {
|
||||||
screen = typeof this.outboundStreamOpts.publisherProperties.videoSource === 'string' &&
|
screen = typeof this.outboundStreamOpts.publisherProperties.videoSource === 'string' &&
|
||||||
this.outboundStreamOpts.publisherProperties.videoSource.startsWith('screen:');
|
this.outboundStreamOpts.publisherProperties.videoSource.startsWith('screen:');
|
||||||
}
|
}
|
||||||
return !!this.outboundStreamOpts && screen;
|
return screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue