summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-04 09:56:26 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-04 13:11:58 +0100
commit371bcc491767b68cc4a2cd4b1633e1b9b9c58c91 (patch)
tree98485b2de4e08ca4d855bb353f1d90b0a86c4346
parentUse constexpr instead of const (diff)
downloadcore-371bcc491767b68cc4a2cd4b1633e1b9b9c58c91.tar.gz
core-371bcc491767b68cc4a2cd4b1633e1b9b9c58c91.zip
cid#1591487 Dereference after null check
Change-Id: I18ec37320fe635af8559718a0f16c25a837197ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162966 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--sc/source/ui/view/tabvwsha.cxx5
1 files changed, 2 insertions, 3 deletions
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 )