diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-07-31 15:04:57 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2020-07-31 16:45:06 +0200 |
commit | 491fa499d6b957b9c8f03fece5ed06d5932e9448 (patch) | |
tree | 67142b4d884e1e23065933d056a0fbfca178ca98 /vcl | |
parent | aed92491f356b008fe1cd25b5cd6cc43279db3a3 (diff) |
tdf#135212 Don't crash when unable to create clipboard
Gracefully handle the case where the SalInstance returns an
empty Reference when trying to create clipboard.
Primary selection support on Wayland has only recently been
added to the relevant KDE components ([1], [2]), and an empty
Reference would be returned for the qt5/kf5 VCL plugin when
trying to create create a clipboard for primary selection
in a Plasma Wayland session with that functionality not yet being
available.
Regression from commit 05d286e0065ff1c10e75827ac4726b5a74747128
("vcl/clipboard: create instances with uno constructors", 2020-07-07).
[1] https://invent.kde.org/plasma/kwayland-server/-/merge_requests/15
[2] https://invent.kde.org/plasma/kwin/-/merge_requests/27
Change-Id: Ia9016f56b775003b2ffe81a6f3bf44f411ad39a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99871
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/components/dtranscomp.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx index 7e5f36f67f7d..bd89a1404e01 100644 --- a/vcl/source/components/dtranscomp.cxx +++ b/vcl/source/components/dtranscomp.cxx @@ -193,7 +193,8 @@ vcl_SystemClipboard_get_implementation( { SolarMutexGuard aGuard; auto xClipboard = ImplGetSVData()->mpDefInst->CreateClipboard( args ); - xClipboard->acquire(); + if (xClipboard.is()) + xClipboard->acquire(); return xClipboard.get(); } |