vcl/source/components/dtranscomp.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 491fa499d6b957b9c8f03fece5ed06d5932e9448
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Jul 31 15:04:57 2020 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Jul 31 16:45:06 2020 +0200

    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.wegh...@posteo.de>

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();
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to