From a5f702eb6ff361cdbd5ecb611da3044ef41a542a Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Wed, 18 Oct 2017 20:58:26 -0200 Subject: [PATCH] Implements proper error handling for Cliboard routine on macOS. --- internal/c/libqb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index 69048da3d..ce9f21aa7 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -24596,14 +24596,14 @@ return -1; err = badPasteboardSyncErr; err = PasteboardGetItemCount( inPasteboard, &itemCount ); - //require_noerr( err, CantGetPasteboardItemCount ); + if ( (err) != noErr ) goto CantGetPasteboardItemCount; for( int itemIndex = 1; itemIndex <= itemCount; itemIndex++ ) { PasteboardItemID itemID; CFDataRef flavorData; err = PasteboardGetItemIdentifier( inPasteboard, itemIndex, &itemID ); - //require_noerr( err, CantGetPasteboardItemIdentifier ); + if ( (err) != noErr ) goto CantGetPasteboardItemIdentifier; err = PasteboardCopyItemFlavorData( inPasteboard, itemID, CFSTR("public.utf8-plain-text"), &flavorData ); data = (char*)CFDataGetBytePtr(flavorData);