sw/source/uibase/shells/textidx.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 5bebb6406a8ca0fa9de1051e8518bf84e070a3ef
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Sep 26 08:18:43 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Sep 26 13:38:58 2024 +0200

    cid#1619696 Dereference after null check
    
    Change-Id: I52bf93d2561c94da0f9129c5df90ec8dd21e4deb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173966
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/uibase/shells/textidx.cxx 
b/sw/source/uibase/shells/textidx.cxx
index c8eb43dba577..7258e0d7c547 100644
--- a/sw/source/uibase/shells/textidx.cxx
+++ b/sw/source/uibase/shells/textidx.cxx
@@ -272,11 +272,14 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet)
         else
             rSet.Put(SfxBoolItem(FN_INSERT_AUTH_ENTRY_DLG, true));
 
-        SfxWhichIter aIter(rSet);
-        if (aIter.FirstWhich() == FN_REMOVE_CUR_TOX)
+        if (pBase)
         {
-            const OUString sLabel = SwResId(STR_DELETEINDEX).replaceAll("%1", 
pBase->GetTypeName());
-            rSet.Put(SfxStringItem(FN_REMOVE_CUR_TOX, sLabel));
+            SfxWhichIter aIter(rSet);
+            if (aIter.FirstWhich() == FN_REMOVE_CUR_TOX)
+            {
+                const OUString sLabel = 
SwResId(STR_DELETEINDEX).replaceAll("%1", pBase->GetTypeName());
+                rSet.Put(SfxStringItem(FN_REMOVE_CUR_TOX, sLabel));
+            }
         }
     }
     else if ( rSh.CursorInsideInputField() )

Reply via email to