sfx2/source/devtools/ObjectInspectorTreeHandler.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 1453345219b2b0a2e4c7cb993737cdf4de9f2217
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Thu Mar 4 21:57:49 2021 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Thu Mar 11 12:47:28 2021 +0100

    devtools: fix crash by checking if xIntrospection is available
    
    It can happen that xIntrospectionAccess object or xIntrospetion
    object can't be created. The app crashed in those cases so add a
    check.
    
    Change-Id: I9cd2d05a11419a918f16cbacaf4b133d3759c5c0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112110
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index 7f969ae24464..a9687635c380 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -535,7 +535,13 @@ void 
GenericPropertiesNode::fillChildren(std::unique_ptr<weld::TreeView>& pTree,
     }
 
     uno::Reference<beans::XIntrospection> xIntrospection = 
beans::theIntrospection::get(mxContext);
+    if (!xIntrospection.is())
+        return;
+
     auto xIntrospectionAccess = xIntrospection->inspect(maAny);
+    if (!xIntrospectionAccess.is())
+        return;
+
     auto xInvocationFactory = css::script::Invocation::create(mxContext);
     uno::Sequence<uno::Any> aParameters = { maAny };
     auto xInvocationInterface = 
xInvocationFactory->createInstanceWithArguments(aParameters);
@@ -610,6 +616,8 @@ ObjectInspectorNodeInterface* 
BasicValueNode::createNodeObjectForAny(OUString co
     return new BasicValueNode(rName, rAny, mxContext);
 }
 
+// helper functions
+
 ObjectInspectorNodeInterface* getSelectedNode(weld::TreeView const& rTreeView)
 {
     OUString sID = rTreeView.get_selected_id();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to