Check that source is not null before calling the screen frame application (#828)

This commit is contained in:
Johan Kwarnmark 2019-12-11 08:44:44 +01:00 committed by Vishwas Shashidhar
parent c5445b3f8f
commit 50dbde9f35

View File

@ -576,12 +576,14 @@ export class WindowHandler {
this.addWindow(opts.winKey, this.screenPickerWindow);
});
ipcMain.once('screen-source-selected', (_event, source) => {
if (isWindowsOS) {
logger.info(`window-handler: screen-source-selected`, source, id);
const type = source.id.split(':')[0];
if (type === 'window') {
const hwnd = source.id.split(':')[1];
this.execCmd(this.screenShareIndicatorFrameUtil, [ hwnd ]);
if (source != null) {
if (isWindowsOS) {
logger.info(`window-handler: screen-source-selected`, source, id);
const type = source.id.split(':')[0];
if (type === 'window') {
const hwnd = source.id.split(':')[1];
this.execCmd(this.screenShareIndicatorFrameUtil, [ hwnd ]);
}
}
}