starmath/source/SmElementsPanel.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit e3270fa567b60d9eba90fbc7b8cc31e63e0216d7
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Mar 21 11:27:15 2025 +0000
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Mar 21 14:50:26 2025 +0100

    GetView() seen as null in crash report
    
    Change-Id: I3597bc22a3e36f11b74f3d0925d765625811fa2f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183200
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins

diff --git a/starmath/source/SmElementsPanel.cxx 
b/starmath/source/SmElementsPanel.cxx
index afe27a80fc50..473ed7a5d20f 100644
--- a/starmath/source/SmElementsPanel.cxx
+++ b/starmath/source/SmElementsPanel.cxx
@@ -60,7 +60,10 @@ SmElementsPanel::SmElementsPanel(weld::Widget& rParent, 
const SfxBindings& rBind
     mxElementsControl->setElementSetIndex(0);
     mxElementsControl->SetSelectHdl(LINK(this, SmElementsPanel, 
ElementClickHandler));
 
-    StartListening(*GetView());
+    SmViewShell* pViewSh = GetView();
+    SAL_WARN_IF(pViewSh, "starmath", "No View for SmElementsPanel to listen 
to");
+    if (pViewSh)
+        StartListening(*pViewSh);
 }
 
 SmElementsPanel::~SmElementsPanel()

Reply via email to