vcl/workben/pasteboard.mm |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 0e3e4b89d752221f795f793d0baf5610c31c6cd3
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Fri Jan 15 18:17:54 2021 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Fri Jan 15 17:42:45 2021 +0100

    Show error message if data for a type is not available
    
    Change-Id: If60a26faa89c2a633a4ac7e2f064f7c144ff2000
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109383
    Tested-by: Tor Lillqvist <t...@collabora.com>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

diff --git a/vcl/workben/pasteboard.mm b/vcl/workben/pasteboard.mm
index 4b003358f8c5..279d3e6cc595 100644
--- a/vcl/workben/pasteboard.mm
+++ b/vcl/workben/pasteboard.mm
@@ -60,7 +60,10 @@ int main(int argc, char** argv)
     {
         NSData* data = [pb dataForType:requestedType];
 
-        std::cout.write((const char*)[data bytes], [data length]);
+        if (data == nil)
+            std::cerr << "No data for " << [requestedType UTF8String] << 
std::endl;
+        else
+            std::cout.write((const char*)[data bytes], [data length]);
 
         return 0;
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to