summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-02 15:24:32 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-02 20:03:10 +0100
commit5bf7bedd45b0eaabec7dfd042a308304785ca0a4 (patch)
treefcf46d9d5dc7807c8a5b5a809fc9500e01082e74 /sw
parentc806247ecc9766a547f3a8451e997b64108d1411 (diff)
cid#1455216 Dereference before null check
Change-Id: I84752fcd154e2e9c344e3ad397f26c1a0d5184c2 Reviewed-on: https://gerrit.libreoffice.org/81941 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/basesh.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index e8600de55c43..67e8ecfd7b64 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2345,7 +2345,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
aBrushItem->SetGraphicPos(GPOS_NONE);
sal_uInt16 nSlotId = SID_BACKGROUND_COLOR ? SID_BACKGROUND_COLOR : SID_TABLE_CELL_BACKGROUND_COLOR;
- if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
+ if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
{
OUString sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
if (sColor == "transparent")
@@ -2364,7 +2364,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
GetView().GetViewFrame()->GetBindings().SetState(aNewColorItem);
}
}
- else if(pArgs)
+ else if (pArgs)
{
const SvxColorItem& rNewColorItem = static_cast<const SvxColorItem&>(pArgs->Get(nSlotId));
const Color& rNewColor = rNewColorItem.GetValue();