cui/source/dialogs/hldoctp.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
New commits: commit 57e6e97659c84574ad444fde3e2716e70011deeb Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Sep 6 19:52:11 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Sep 9 13:20:23 2024 +0200 cid#1619147 Dereference before null check maybe it possible in --headless that ShowMarkWnd launches weld::DialogController::runAsync(mxMarkWnd, [this](sal_Int32 /*nResult*/) { mxMarkWnd.reset(); } ); and the auto-cancel calls mxMarkWnd.reset() immediately? Otherwise, not sure how this could come about. Change-Id: I761ee7450a8ba54b2a7f75d4ee116c30319ddaa8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172976 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit c8eb95e8407ef24436e0e8e218dce535df6bb2e5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173014 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173063 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index a971cd1145b0..c61b22519cd1 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -207,6 +207,9 @@ IMPL_LINK_NOARG(SvxHyperlinkDocTp, ClickTargetHdl_Impl, weld::Button&, void) { ShowMarkWnd(); + if (!mxMarkWnd) + return; + if ( GetPathType ( maStrURL ) == EPathType::ExistsFile || maStrURL.isEmpty() || maStrURL.equalsIgnoreAsciiCase( INET_FILE_SCHEME ) || @@ -216,13 +219,10 @@ IMPL_LINK_NOARG(SvxHyperlinkDocTp, ClickTargetHdl_Impl, weld::Button&, void) weld::WaitObject aWait(mpDialog->getDialog()); - if (mxMarkWnd) - { - if ( maStrURL.equalsIgnoreAsciiCase( INET_FILE_SCHEME ) ) - mxMarkWnd->RefreshTree ( "" ); - else - mxMarkWnd->RefreshTree ( maStrURL ); - } + if ( maStrURL.equalsIgnoreAsciiCase( INET_FILE_SCHEME ) ) + mxMarkWnd->RefreshTree ( "" ); + else + mxMarkWnd->RefreshTree ( maStrURL ); } else mxMarkWnd->SetError( LERR_DOCNOTOPEN );