diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index b7a1be1bbe..4e7ee27447 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -170,13 +170,7 @@ export default class ElectronPlatform extends VectorBasePlatform { window.electron.on("openDesktopCapturerSourcePicker", () => { const { finished } = Modal.createDialog(DesktopCapturerSourcePicker); finished.then(([source]) => { - if (!source) - source = { - id: "", - name: "", - thumbnailURL: "" - }; - this.ipc.call("callDisplayMediaCallback", source); + this.ipc.call("callDisplayMediaCallback", source ?? { id: "", name: "", thumbnailURL: "" }); }); });