diff --git a/app/os_macos.go b/app/os_macos.go index 93b7a4e8..9011c231 100644 --- a/app/os_macos.go +++ b/app/os_macos.go @@ -297,7 +297,9 @@ func (w *window) contextView() C.CFTypeRef { func (w *window) ReadClipboard() { cstr := C.readClipboard() - defer C.CFRelease(cstr) + if cstr != 0 { + defer C.CFRelease(cstr) + } content := nsstringToString(cstr) w.w.Event(clipboard.Event{Text: content}) }