diff --git a/crates/call/src/call_impl/room.rs b/crates/call/src/call_impl/room.rs index 31ca144cf8..7aac72ed46 100644 --- a/crates/call/src/call_impl/room.rs +++ b/crates/call/src/call_impl/room.rs @@ -1389,10 +1389,17 @@ impl Room { let sources = cx.screen_capture_sources(); cx.spawn(async move |this, cx| { - let sources = sources.await??; - let source = sources.first().context("no display found")?; + let sources = sources + .await + .map_err(|error| error.into()) + .and_then(|sources| sources); + let source = + sources.and_then(|sources| sources.into_iter().next().context("no display found")); - let publication = participant.publish_screenshare_track(&**source, cx).await; + let publication = match source { + Ok(source) => participant.publish_screenshare_track(&*source, cx).await, + Err(error) => Err(error), + }; this.update(cx, |this, cx| { let live_kit = this