sw/source/uibase/uiview/viewsrch.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
New commits: commit 4707d8968c7d4723e45d111b2136eed78acccdee Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Dec 15 16:20:31 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Dec 16 19:47:08 2022 +0000 likely fix for frequent SfxViewFrame::GetChildWindow() crash crash report id: 58e9a91e-9feb-4eb4-a28e-27921d3e1b99 Change-Id: I110d96f1c73f95025918ccc4043dac40c5e1dc4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144189 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 3fe2c0a1864bb775c2e35166eb0019ab18e9c661) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144259 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index 04831dfccac9..118116423e45 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -821,9 +821,13 @@ SvxSearchDialog* SwView::GetSearchDialog() { #if HAVE_FEATURE_DESKTOP const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId(); - SvxSearchDialogWrapper *pWrp = static_cast<SvxSearchDialogWrapper*>( SfxViewFrame::Current()->GetChildWindow(nId) ); - auto pSrchDlg = pWrp ? pWrp->getDialog() : nullptr; - return pSrchDlg; + SfxViewFrame* pFrame = SfxViewFrame::Current(); + if (!pFrame) + return nullptr; + SvxSearchDialogWrapper *pWrp = static_cast<SvxSearchDialogWrapper*>(pFrame->GetChildWindow(nId)); + if (!pWrp) + return nullptr; + return pWrp->getDialog(); #else return nullptr; #endif