Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

windows: Improve platform clipboard (#11553)

CharlesChen08232e0811e11301
diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rs
index 2da0e7acb1f..efd3695843e 100644
--- a/crates/gpui/src/platform/windows/platform.rs
+++ b/crates/gpui/src/platform/windows/platform.rs
@@ -684,7 +684,7 @@ impl Platform for WindowsPlatform {
fn read_from_clipboard(&self) -> Option<ClipboardItem> {
let mut ctx = ClipboardContext::new().unwrap();
- let content = ctx.get_contents().unwrap();
+ let content = ctx.get_contents().ok()?;
Some(ClipboardItem {
text: content,
metadata: None,