sfx2/source/view/viewsh.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 9a91a2899947bc906ea5b7b1a740f00cce04a3c0
Author:     Mike Kaganski <[email protected]>
AuthorDate: Mon May 19 10:46:45 2025 +0200
Commit:     Mike Kaganski <[email protected]>
CommitDate: Mon May 19 12:55:55 2025 +0200

    tdf#166637: Do not dereference a result of UNO_QUERY unconditionally
    
    Change-Id: Ifdf3d6fe44ce93e28c679985959db5b56bb5580a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185506
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 04a363fa0a10..3d23d7a3d935 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2824,6 +2824,10 @@ uno::Reference<beans::XPropertySet>
 GetSelectedShapeOfView(const uno::Reference<frame::XController>& xController)
 {
     uno::Reference<view::XSelectionSupplier> xSelectionSupplier(xController, 
uno::UNO_QUERY);
+    if (!xSelectionSupplier)
+    {
+        return {};
+    }
     uno::Reference<drawing::XShapes> 
xShapes(xSelectionSupplier->getSelection(), uno::UNO_QUERY);
     if (!xShapes.is() || xShapes->getCount() != 1)
     {

Reply via email to