diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-01-15 18:17:54 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2021-01-15 17:42:45 +0100 |
commit | 0e3e4b89d752221f795f793d0baf5610c31c6cd3 (patch) | |
tree | ee2567705193d1ed84e891f2f019c84c9defe557 /vcl | |
parent | 042bb632978a1d01f3240890ea9d39ead707633d (diff) |
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 <tml@collabora.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/workben/pasteboard.mm | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |