From 665790e8f5067340832d35f25c464335a367ffd0 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Mon, 1 Nov 2021 11:41:33 +0100 Subject: [PATCH] fix(clipboard): fix missing return type of macOS. Fix #826 --- espanso-clipboard/src/cocoa/native.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/espanso-clipboard/src/cocoa/native.mm b/espanso-clipboard/src/cocoa/native.mm index b60f56d..91ed16a 100644 --- a/espanso-clipboard/src/cocoa/native.mm +++ b/espanso-clipboard/src/cocoa/native.mm @@ -44,7 +44,11 @@ int32_t clipboard_set_text(char * text) { [pasteboard declareTypes:array owner:nil]; NSString *nsText = [NSString stringWithUTF8String:text]; - [pasteboard setString:nsText forType:NSPasteboardTypeString]; + if (![pasteboard setString:nsText forType:NSPasteboardTypeString]) { + return 0; + } + + return 1; } int32_t clipboard_set_image(char * image_path) {