diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-03-21 16:55:59 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-03-22 12:03:50 +0000 |
commit | 74f398bb58510087cc4a11bb2253715771a2c6b2 (patch) | |
tree | 617b374a33d8fcd67be2e74225dbc3ef1d9159d0 /sw/source/uibase/ribbar/inputwin.cxx | |
parent | d41c3c820dad7c78bc57815e0f4a6999d125561d (diff) |
sw: check GetActiveView()
See https://crashreport.libreoffice.org/stats/signature/SwView::GetDocShell()
Change-Id: I90ebbff5082f1f9cae7fa3b940cbb9796d6c6dd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149223
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/source/uibase/ribbar/inputwin.cxx')
-rw-r--r-- | sw/source/uibase/ribbar/inputwin.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 675390d4e9ac..9a5c12707991 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -334,9 +334,11 @@ void SwInputWindow::ApplyFormula() if (!m_pView || !m_pWrtShell) { // presumably there must be an active view now since the event arrived - SwView *const pActiveView = ::GetActiveView(); - // this just makes the input window go away, so that the next time it works - pActiveView->GetViewFrame().GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON); + if (SwView* pView = GetActiveView()) + { + // this just makes the input window go away, so that the next time it works + pView->GetViewFrame().GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON); + } return; } @@ -367,9 +369,11 @@ void SwInputWindow::CancelFormula() if (!m_pView || !m_pWrtShell) { // presumably there must be an active view now since the event arrived - SwView *const pActiveView = ::GetActiveView(); - // this just makes the input window go away, so that the next time it works - pActiveView->GetViewFrame().GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON); + if (SwView* pView = GetActiveView()) + { + // this just makes the input window go away, so that the next time it works + pView->GetViewFrame().GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::ASYNCHRON); + } return; } |