diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-02 15:12:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-02 18:11:32 +0100 |
commit | 5876ae7e4b6ea8023cfa165998f4306cfe63b70b (patch) | |
tree | fb36297aa261ba68ae376a5cf84e4ff18e01daef | |
parent | 81b4f551781e7a3ec1b6d4755bfc90c76c26f847 (diff) |
cid#1455211 Dereference after null check
Change-Id: I73ce64812d4ff88f7b1d0e122c208d64f04b893d
Reviewed-on: https://gerrit.libreoffice.org/81937
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 0788f49e52a3..cf45dc26e513 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1184,7 +1184,7 @@ void SwTextShell::Execute(SfxRequest &rReq) aSet = static_cast<const SvxColorItem*>(pItem)->GetValue(); bHasItem = true; } - else if(SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem)) + else if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem)) { sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue(); aSet = Color(sColor.toInt32(16)); @@ -1216,7 +1216,7 @@ void SwTextShell::Execute(SfxRequest &rReq) OUString sColor; const SfxPoolItem* pColorStringItem = nullptr; - if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem)) + if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem)) { sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue(); if (sColor == "transparent") |