From 83e1d079c4304ed43dfe8f9c92490d1bd4963f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 4 Mar 2022 14:11:46 +0000 Subject: [PATCH] cid#1500667 Explicit null dereferenced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I can't see how destroyingthe widget is a good idea here Change-Id: Ie4b2dcf9136568b01b5f4b85bcc849ad1c0504a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130992 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/sidebar/shadow/ShadowPropertyPanel.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx index ff21110a2007..93259adc27f0 100644 --- a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx +++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx @@ -271,15 +271,10 @@ void ShadowPropertyPanel::NotifyItemUpdate( if(eState >= SfxItemState::DEFAULT) { const SdrOnOffItem* pItem = dynamic_cast< const SdrOnOffItem* >(pState); - if(pItem) - { - if (pItem->GetValue()) - mxShowShadow->set_state(TRISTATE_TRUE); - else - mxShowShadow->set_state(TRISTATE_FALSE); - } + if (pItem && pItem->GetValue()) + mxShowShadow->set_state(TRISTATE_TRUE); else - mxShowShadow.reset(); + mxShowShadow->set_state(TRISTATE_FALSE); } } break;