Windows: Fix crash when trying to copy nothing to clipboard (#10405)
Release Notes: - N/A
This commit is contained in:
parent
065f15e9a6
commit
cb6d0639db
1 changed files with 4 additions and 2 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue