Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Windows: Fix crash when trying to copy nothing to clipboard (#10405)
usrcb6d0639db0e
diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rsindex f59a8672f74..a4a7d6249e8 100644--- a/crates/gpui/src/platform/windows/platform.rs+++ b/crates/gpui/src/platform/windows/platform.rs@@ -687,8 +687,10 @@ impl Platform for WindowsPlatform {}fn write_to_clipboard(&self, item: ClipboardItem) {- let mut ctx = ClipboardContext::new().unwrap();- ctx.set_contents(item.text().to_owned()).unwrap();+ if item.text.len() > 0 {+ let mut ctx = ClipboardContext::new().unwrap();+ ctx.set_contents(item.text().to_owned()).unwrap();+ }}fn read_from_clipboard(&self) -> Option<ClipboardItem> {