sd/source/ui/func/fuinsfil.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
New commits: commit 836e001c8632702c2eda7b5bac799ef5f1a24cdf Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Dec 4 16:07:03 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Dec 4 20:48:22 2022 +0000 cid#1517255 Dereference null return value Change-Id: Idb1a7790851a3416f84e99c7fd95e12e18b449f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143632 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 729652e03c34..f18d6779f203 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -237,12 +237,10 @@ void FuInsertFile::DoExecute( SfxRequest& rReq ) else { const SfxStringItem* pFileName = rReq.GetArg<SfxStringItem>(ID_VAL_DUMMY0); - const SfxStringItem* pFilterName = rReq.GetArg<SfxStringItem>(ID_VAL_DUMMY1); - - aFile = pFileName->GetValue (); - - if( pFilterName ) - aFilterName = pFilterName->GetValue (); + assert(pFileName && "must be present"); + aFile = pFileName->GetValue(); + if (const SfxStringItem* pFilterName = rReq.GetArg<SfxStringItem>(ID_VAL_DUMMY1)) + aFilterName = pFilterName->GetValue(); } mpDocSh->SetWaitCursor( true );