sc/source/ui/view/tabvwsha.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 371bcc491767b68cc4a2cd4b1633e1b9b9c58c91
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Feb 4 09:56:26 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Feb 4 13:11:58 2024 +0100

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

diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 1a33903d241f..931a8180ead9 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -1037,7 +1037,7 @@ void ScTabViewShell::ExecStyle( SfxRequest& rReq )
         case SID_STYLE_NEW_BY_EXAMPLE:
             {
                 const SfxPoolItem* pNameItem;
-                if (pArgs && SfxItemState::SET == pArgs->GetItemState( 
nSlotId, true, &pNameItem ))
+                if (pArgs && SfxItemState::SET == pArgs->GetItemState(nSlotId, 
true, &pNameItem))
                     aStyleName = static_cast<const 
SfxStringItem*>(pNameItem)->GetValue();
                 else if ( nSlotId == SID_STYLE_NEW_BY_EXAMPLE )
                 {
@@ -1064,8 +1064,7 @@ void ScTabViewShell::ExecStyle( SfxRequest& rReq )
             {
                 const SfxPoolItem* pItem;
 
-                if ( SfxItemState::SET ==
-                     pArgs->GetItemState( nSlotId, true, &pItem ) )
+                if (pArgs && SfxItemState::SET == pArgs->GetItemState(nSlotId, 
true, &pItem))
                 {
                     const SfxStringItem* pStrItem = dynamic_cast< const 
SfxStringItem *>( pItem );
                     if ( pStrItem )

Reply via email to