diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-18 15:50:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-19 16:18:37 +0100 |
commit | 432f4369cdb62fd05abbde50804ff4e1d5011f39 (patch) | |
tree | 200982ca3758bdcb37e9fdd19b45f6842c41ede0 | |
parent | d633d8455aff440a5b573cfa34557c7310e688a1 (diff) |
coverity#1427648 Dereference after null check
Change-Id: Ib4be7b819a5ba68d78d98d8ae05d755898f3cad1
Reviewed-on: https://gerrit.libreoffice.org/48136
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 561ba1de9cea..b7e001cbd769 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -199,9 +199,12 @@ void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, const if (bUseDialog) { - std::shared_ptr<SfxRequest> pRequest(new SfxRequest(*pReq)); - pReq->Ignore(); // the 'old' request is not relevant any more - + std::shared_ptr<SfxRequest> pRequest; + if (pReq) + { + pRequest.reset(new SfxRequest(*pReq)); + pReq->Ignore(); // the 'old' request is not relevant any more + } pDlg->StartExecuteAsync([pDlg, &rWrtSh, pCoreSet, bSel, bSelectionPut, pRequest](sal_Int32 nResult){ if (nResult == RET_OK) { |