From dce1b34a62ad204f995f626064ccf6b71e59c9f5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 22 Dec 2017 09:48:59 +0000 Subject: coverity#1426874 bogus Dereference after null check Change-Id: Icb3ad60a7ec314182e06af179d9d5c3a1f3babcb --- sw/source/uibase/shells/basesh.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 173c8d69d372..7428455dfb7b 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2260,7 +2260,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) const SfxItemSet* pArgs = rReq.GetArgs(); sal_uInt16 nSlot(rReq.GetSlot()); - if(!pArgs && nSlot != SID_BACKGROUND_COLOR) + if (!pArgs && nSlot != SID_BACKGROUND_COLOR) { return; } @@ -2314,6 +2314,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) case SID_ATTR_BRUSH: case RES_BACKGROUND: { + assert(pArgs && "only SID_BACKGROUND_COLOR can have !pArgs, checked at entry"); const SvxBrushItem& rNewBrushItem = static_cast(pArgs->Get(GetPool().GetWhich(nSlot))); aBrushItem = rNewBrushItem; break; -- cgit